Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encode ¶
func Encode(w io.Writer, data map[string]interface{}, pe ...PreEncoder) error
Encode encodes the given data to YAML format and writes it to the provided io.Write, without going through a byte representation (unlike sigs.k8s.io/yaml#Unmarshal).
It optionally takes one or more PreEncoder functions that allow for pre-processing of the data before encoding, such as sorting the data.
It returns an error if the data cannot be encoded.
func SortMapSlice ¶
SortMapSlice recursively sorts the given goyaml.MapSlice by key. It can be used in combination with Encode to sort YAML by key before encoding it.
Types ¶
type PreEncoder ¶
PreEncoder allows for pre-processing of the YAML data before encoding.
Click to show internal directories.
Click to hide internal directories.