Documentation
¶
Overview ¶
Package yaml provides functions for encoding/decoding YAML.
This package is a small wrapper for other packages or packages which do the heavy lifting. The purpose of this package is providing a stable and easy to find YAML API in Gondola, so users don't have to search and evaluate the miriad of different alternatives available when it comes to parsing YAML in Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
Marshal returns the YAML encoding of the in argument. Unexported field names are ignored, while exported files are serialized using their name in lowercase as the key. The "yaml" struct tag might be used to control the serialization, using the following format:
`yaml:"[name][,flag1][,flag2][,flagn]"
Supported flags are:
omitempty Ignore the field if it's not set the zero for its type, or if it's an empty slice or map
flow Marshal using a flow style, using explicit indicatos rather than indentation to denote scope (this only applies for structs, slices, arrays and maps).
inline Inline the field it's applied to, so its fields are processed as if they were part of the outer struct.
Additionally, if the name of the field is set to "-", the field will be skipped.
func Unmarshal ¶
Unmarshal parses the YAML-encoded in data and decodes it into the value pointed by out. See Marshal for the available struct field tags.
func UnmarshalFile ¶
UnmarshalFile works like Unmarshal, but accepts a filename rather than the encoded YAML data.
func UnmarshalReader ¶
UnmarshalReader works like Unmarshal, but accepts an io.Reader rather than the encoded YAML data.
Types ¶
This section is empty.