yaml

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File2Document

func File2Document(filename string, filterKind string) *ast.DocumentNode

Read specify document by filterKind from specify file, return first document when filterKind is empty

func GetByPath

func GetByPath(doc io.Reader, path *yaml.Path) (string, error)

Get specify node string from yaml by path, panic if occur error

func GetByPathString

func GetByPathString(doc io.Reader, path string) (string, error)

Get specify node string from yaml by path string

func MergeStringsToOneYAML

func MergeStringsToOneYAML(yamlList []string) string

Merge multiple yaml string into a single string, separate yaml documents with '---'

func MergeToOneYAML

func MergeToOneYAML(yamlList ...interface{}) string

TODO: yamlv3.Marshal will reduce leading "/n" character Merge multiple yaml documents into a single string, separate yaml documents with '---'

func MustGetByPath

func MustGetByPath(doc io.Reader, path *yaml.Path) string

Get specify node string from yaml by path, panic if occur error

func MustGetByPathString

func MustGetByPathString(doc io.Reader, path string) string

Get specify node string from yaml by path string, panic if occur error

func ParseYamlFromFile

func ParseYamlFromFile(filename string, target interface{}) error

Parse yaml data by file name

func YAML2Documents

func YAML2Documents(yamlContent string) ([]*ast.DocumentNode, error)

Convert yaml string to []ast.Document

Types

This section is empty.

Jump to

Keyboard shortcuts

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