utils

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParsedYAMLFiles map[string]*yaml.Node

Functions

func CopyFile

func CopyFile(dest string, src string) error

func JSONPointer2JSONPath added in v0.1.2

func JSONPointer2JSONPath(jsonPointer string) (jsonPath string, err error)

func MustReadFileBytes added in v0.1.2

func MustReadFileBytes(path string) []byte

func ParseYAMLFile

func ParseYAMLFile(filePath string) (*yaml.Node, error)

func ResolveYAMLRef

func ResolveYAMLRef(node *yaml.Node, nodePath string) (*yaml.Node, error)

func ResolveYAMLRefs

func ResolveYAMLRefs(node *yaml.Node, nodePath string) (*yaml.Node, error)

func SplitJSONRef added in v0.1.2

func SplitJSONRef(refStr string) (location string, jsonPath string, err error)

func Struct2XMLDocText

func Struct2XMLDocText(p any) ([]byte, error)

func Text2XML

func Text2XML(reader io.Reader) (*etree.Document, error)

func Text2YAML

func Text2YAML(reader io.Reader) (*yaml.Node, error)

func XML2Text

func XML2Text(doc *etree.Document) ([]byte, error)

func XML2YAML

func XML2YAML(doc *etree.Document) (*yaml.Node, error)

func XML2YAMLRecursive

func XML2YAMLRecursive(ele *etree.Element) (key *yaml.Node, value *yaml.Node, err error)

func XML2YAMLText

func XML2YAMLText(doc *etree.Document, indent int) ([]byte, error)

func XMLText2XML

func XMLText2XML(reader io.Reader) (*etree.Document, error)

func XMLText2YAML

func XMLText2YAML(reader io.Reader) (*yaml.Node, error)

func XMLText2YAMLText added in v0.1.2

func XMLText2YAMLText(reader io.Reader) ([]byte, error)

func XMLTextFormat

func XMLTextFormat(reader io.Reader) ([]byte, error)

func YAML2Text

func YAML2Text(node *yaml.Node, indent int) ([]byte, error)

func YAML2XML

func YAML2XML(node *yaml.Node) (*etree.Document, error)

func YAML2XMLRecursive

func YAML2XMLRecursive(node *yaml.Node, parent *etree.Element) (*etree.Element, error)

func YAML2XMLText

func YAML2XMLText(node *yaml.Node) ([]byte, error)

func YAMLDoc2File added in v0.1.5

func YAMLDoc2File(docNode *yaml.Node, outputFile string) error

func YAMLText2XML

func YAMLText2XML(reader io.Reader) (*etree.Document, error)

func YAMLText2XMLText added in v0.1.2

func YAMLText2XMLText(reader io.Reader) ([]byte, error)

Types

type StdoutCapture added in v0.1.5

type StdoutCapture struct {
	// contains filtered or unexported fields
}

func NewStdoutCapture added in v0.1.5

func NewStdoutCapture() (*StdoutCapture, error)

func (*StdoutCapture) Read added in v0.1.5

func (sf *StdoutCapture) Read() ([]byte, error)

func (*StdoutCapture) Restore added in v0.1.5

func (sf *StdoutCapture) Restore()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL