Documentation
¶
Index ¶
- func AddEntryToOASYAML(oas *yaml.Node, key string, value any, defaultVal *yaml.Node) (*yaml.Node, error)
- func ApplyOASOverlay(overlayNode *yaml.Node, specNode *yaml.Node, overlayFile string, ...) (*yaml.Node, error)
- func ApplyOASOverlayAction(action *yaml.Node, specNode *yaml.Node, overlayFile string, specFile string) (*yaml.Node, error)
- func CopyDir(dest string, src string) error
- func CopyFile(dest string, src string) error
- func GetDocMapRoot(yamlNode *yaml.Node) *yaml.Node
- func GetFieldOrCreateNew(node *yaml.Node, key string, value *yaml.Node) *yaml.Node
- func HandleTestPanic(t *testing.T)
- func JSONFile2YAMLFile(input string, output string) error
- func JSONFileToTFFile(input string, output string) error
- func JSONPointer2JSONPath(jsonPointer string) (jsonPath string, err error)
- func JSONText2YAMLText(reader io.Reader) ([]byte, error)
- func JSONTextToTFText(jsonBytes []byte, fileName string) ([]byte, error)
- func LocateRef(refFileNode *yaml.Node, refJSONPath string, jsonRef string) (*yaml.Node, error)
- func MakeCyclicRefPlaceholder(refJSONPath string) *yaml.Node
- func MapToTFText(data map[string]any, fileName string) ([]byte, error)
- func Must(err error)
- func MustClose(c io.Closer)
- func MustReadFileBytes(path string) []byte
- func MustRemoveAll(path string)
- func NewCyclicJSONRefError(paths []string) error
- func NewMapNode() *yaml.Node
- func NewRefNode(refJSONPath string) *yaml.Node
- func NewStringNode(value string, style yaml.Style) *yaml.Node
- func OAS2FileToOAS3File(input string, output string, allowCycles bool) error
- func OAS2YAMLtoOAS3YAML(oasNode *yaml.Node) (*yaml.Node, error)
- func OAS3ToYAML(doc *openapi3.T) (*yaml.Node, error)
- func OASOverlay(overlayFile string, specFile string, outputFile string) error
- func PushDir(dir string) func()
- func ReadInputText(input string) ([]byte, error)
- func ReadInputTextFile(input string) ([]byte, error)
- func RemoveExtensions(input string, output string) error
- func RemoveOASExtensions(root *yaml.Node) (*yaml.Node, error)
- func RemoveOASExtensionsRecursive(node *yaml.Node, parentField string) (*yaml.Node, error)
- func RemoveOASSchemaExtensions(root *yaml.Node) (*yaml.Node, error)
- func RemoveSchemaExtensions(input string, output string) error
- func RemoveYAMLComments(data []byte) []byte
- func RequireBundleZipEquals(t *testing.T, expectedBundleZip string, actualBundleZip string)
- func ResolveDollarRefs(input string, output string, allowCycles bool) error
- func Run(name string, arg ...string) (string, error)
- func RunNPMTTest(t *testing.T, targetDir string)
- func RunT(cmd *exec.Cmd, t *testing.T)
- func SplitJSONRef(refStr string) (location string, jsonPath string, err error)
- func Struct2XMLDocText(p any) ([]byte, error)
- func TFFileToJSONFile(input string, output string) error
- func TFFileToMap(f *hcl.File, fileName string) (map[string]any, error)
- func TFText2HCLFile(fileText string, filePath string) (*hcl.File, error)
- func TFTextToJSONText(text []byte, fileName string) ([]byte, error)
- func TFTextToMap(text []byte, fileName string) (map[string]any, error)
- func Text2XML(reader io.Reader) (*etree.Document, error)
- func Text2YAML(reader io.Reader) (*yaml.Node, error)
- func ToV3(doc2 *openapi2.T) (*openapi3.T, error)
- func UnFlowYAMLNode(node *yaml.Node) *yaml.Node
- func WriteOutputText(output string, outputText []byte) error
- func XML2Text(doc *etree.Document) ([]byte, error)
- func XML2YAML(doc *etree.Document) (*yaml.Node, error)
- func XML2YAMLRecursive(ele *etree.Element) (key *yaml.Node, value *yaml.Node, err error)
- func XML2YAMLText(doc *etree.Document, indent int) ([]byte, error)
- func XMLFile2YAMLFile(input string, output string) error
- func XMLText2XML(reader io.Reader) (*etree.Document, error)
- func XMLText2YAML(reader io.Reader) (*yaml.Node, error)
- func XMLText2YAMLText(reader io.Reader) ([]byte, error)
- func XMLTextFormat(reader io.Reader) ([]byte, error)
- func YAML2Text(node *yaml.Node, indent int) ([]byte, error)
- func YAML2XML(node *yaml.Node) (*etree.Document, error)
- func YAML2XMLRecursive(node *yaml.Node, parent *etree.Element) (*etree.Element, error)
- func YAML2XMLText(node *yaml.Node) ([]byte, error)
- func YAMLDetectRefCycles(root *yaml.Node, filePath string) (cycles [][]string, err error)
- func YAMLDetectRefCyclesRecursive(node *yaml.Node, relParentPath string, parentFile string, activePaths []string, ...) error
- func YAMLDoc2File(docNode *yaml.Node, outputFile string) error
- func YAMLFile2JSONFile(input string, output string) error
- func YAMLFile2XMLFile(input string, output string) error
- func YAMLFile2YAML(filePath string) (*yaml.Node, error)
- func YAMLResolveAllRefs(root *yaml.Node, filePath string, allowCycles bool) (*yaml.Node, error)
- func YAMLResolveRefs(root *yaml.Node, filePath string, allowCycles bool) (*yaml.Node, error)
- func YAMLResolveRefsRecursive(node *yaml.Node, relParentPath string, parentFile string, activePaths []string, ...) (*yaml.Node, error)
- func YAMLText2JSONText(reader io.Reader) ([]byte, error)
- func YAMLText2XML(reader io.Reader) (*etree.Document, error)
- func YAMLText2XMLText(reader io.Reader) ([]byte, error)
- type CyclicJSONRefError
- type MultiError
- type StdoutCapture
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddEntryToOASYAML ¶
func ApplyOASOverlay ¶
func ApplyOASOverlayAction ¶
func GetFieldOrCreateNew ¶
func HandleTestPanic ¶ added in v1.1.0
func JSONFile2YAMLFile ¶
func JSONFileToTFFile ¶ added in v1.1.0
JSONFileToTFFile reads a Terraform JSON file (.tf.json), converts it to HCL text, and writes it.
func JSONPointer2JSONPath ¶
func JSONTextToTFText ¶ added in v1.1.0
JSONTextToTFText converts Terraform JSON text bytes into formatted Terraform HCL text bytes.
func MapToTFText ¶ added in v1.1.0
MapToTFText converts a map[string]any into a formatted Terraform HCL text byte slice.
func MustReadFileBytes ¶
func MustRemoveAll ¶ added in v1.1.0
func MustRemoveAll(path string)
func NewCyclicJSONRefError ¶
func NewMapNode ¶
func NewRefNode ¶
func OAS2FileToOAS3File ¶
func ReadInputText ¶
func ReadInputTextFile ¶
func RemoveExtensions ¶
func RemoveOASSchemaExtensions ¶ added in v1.1.1
func RemoveSchemaExtensions ¶ added in v1.1.1
func RemoveYAMLComments ¶
func RequireBundleZipEquals ¶
func ResolveDollarRefs ¶
func RunNPMTTest ¶ added in v1.1.0
RunNPMTTest checks for 'npm' and 'node' in PATH and skips the test if either is not found. If available, it changes the working directory to targetDir, runs 'npm install', and then executes 'npm run unit-test', streaming the output directly.
func Struct2XMLDocText ¶
func TFFileToJSONFile ¶ added in v1.1.0
TFFileToJSONFile converts a Terraform HCL file (.tf) to a JSON file.
func TFFileToMap ¶ added in v1.1.0
TFFileToMap converts a parsed Terraform hcl.File into a generic map[string]interface{}.
func TFText2HCLFile ¶ added in v1.1.0
func TFTextToJSONText ¶ added in v1.1.0
TFTextToJSONText converts Terraform HCL text bytes to Terraform JSON text bytes.
func TFTextToMap ¶ added in v1.1.0
TFTextToMap converts Terraform HCL text bytes to a Go map[string]any.
func WriteOutputText ¶
func XML2YAMLRecursive ¶
func XMLFile2YAMLFile ¶
func YAML2XMLRecursive ¶
func YAMLDetectRefCycles ¶
func YAMLFile2JSONFile ¶
func YAMLFile2XMLFile ¶
func YAMLResolveAllRefs ¶ added in v1.1.0
func YAMLResolveRefs ¶
Types ¶
type CyclicJSONRefError ¶
type CyclicJSONRefError struct {
Paths []string
}
func (CyclicJSONRefError) Error ¶
func (e CyclicJSONRefError) Error() string
type MultiError ¶
type MultiError struct {
Errors []error
}
func (MultiError) Error ¶
func (e MultiError) Error() string
type StdoutCapture ¶
type StdoutCapture struct {
// contains filtered or unexported fields
}
func NewStdoutCapture ¶
func NewStdoutCapture() (*StdoutCapture, error)
func (*StdoutCapture) Read ¶
func (sf *StdoutCapture) Read() ([]byte, error)
func (*StdoutCapture) Restore ¶
func (sf *StdoutCapture) Restore()