Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
Marshal serializes the value provided into a YAML document. The structure of the generated document will reflect the structure of the value itself. Maps and pointers (to struct, string, int, etc.) are accepted as the in value.
See yaml.Marshal for detail docs.
func Unmarshal ¶
Unmarshal decodes the first document found within the in byte slice and assigns decoded values into the out value.
Maps and pointers (to a struct, string, int, etc.) are accepted as out values. If an internal pointer within a struct is not initialized, the yaml package will initialize it if necessary for unmarshalling the provided data. The out parameter must not be nil.
See yaml.Unmarshal for detail docs.
Note that this package adds extra features on the standard YAML syntax, such as "reading environment variables", "file including", "reference using gjson JSON path expression", "reference using named variables", "function calling", etc.
Types ¶
type FuncMap ¶
FuncMap is the type of the map defining the mapping from names to functions. Each function must have either a single return value, or two return values of which the second is an error. In case the second return value evaluates to a non-nil error during execution, the execution terminates and the error will be returned.
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option customizes the behavior of the extended YAML parser.
func EnableEnv ¶
func EnableEnv() Option
EnableEnv enables reading environment variables. By default, it is disabled for security considerations.
func EnableInclude ¶
func EnableInclude() Option
EnableInclude enables including other files. By default, it is disabled for security considerations.
func WithFuncMap ¶
WithFuncMap specifies additional functions to use with the "@@fn" directive.
func WithIncludeDirs ¶
WithIncludeDirs optionally specifies the directories to find include files. By default, the current working directory is used to search include files.