yaml

package
v2.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Validator = validator.New()
)

Functions

func Exists

func Exists(p string) bool

func FixNameExt

func FixNameExt(dir string, name string) string

func FixPathExt

func FixPathExt(p string) string

func ReadYamlAllBytes

func ReadYamlAllBytes(b []byte) ([]interface{}, error)

func ReadYamlAllFile

func ReadYamlAllFile(p string) ([]interface{}, error)

func ReadYamlAllStream

func ReadYamlAllStream(r io.Reader) ([]interface{}, error)

func ReadYamlAllString

func ReadYamlAllString(s string) ([]interface{}, error)

func ReadYamlBytes

func ReadYamlBytes(b []byte, o interface{}) error

func ReadYamlFile

func ReadYamlFile(p string, o interface{}) error

func ReadYamlStream

func ReadYamlStream(r io.Reader, o interface{}) error

func ReadYamlString

func ReadYamlString(s string, o interface{}) error

func RemoveDuplicateFields added in v2.12.6

func RemoveDuplicateFields(r io.Reader) ([]byte, error)

RemoveDuplicateFields is a helper/hack to remove duplicate fields from yaml maps/structs. The yaml spec explicitly forbids duplicate keys, but yaml.v2 ignored those by default, leading to some tools (e.g. Helm) ignoring these

func ValidateStructs added in v2.12.6

func ValidateStructs(s interface{}) error

func WriteJsonString added in v2.14.0

func WriteJsonString(o interface{}) (string, error)

func WriteJsonStringMust added in v2.20.0

func WriteJsonStringMust(o interface{}) string

func WriteYamlAllBytes

func WriteYamlAllBytes(l []interface{}) ([]byte, error)

func WriteYamlAllFile

func WriteYamlAllFile(p string, l []interface{}) error

func WriteYamlAllStream

func WriteYamlAllStream(w io.Writer, l []interface{}) error

func WriteYamlAllString

func WriteYamlAllString(l []interface{}) (string, error)

func WriteYamlBytes

func WriteYamlBytes(o interface{}) ([]byte, error)

func WriteYamlFile

func WriteYamlFile(p string, o interface{}) error

func WriteYamlString

func WriteYamlString(o interface{}) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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