Documentation ¶
Overview ¶
yamlencoder provides a way to encode both the simple form and the detailed form of configuration data for the goschtalt library.
Detailed Output ¶
The details about where the configuration value originated are included as a list of `file:line[col]` values in a comment if goschtalt knows the origin. Not all decoders support tracking all this information. Comment will always be present so it's easier to handle the file using simple cli text processors.
Example
candy: bar # file.yml:1[8] cats: # file.yml:2[1] - madd # file.yml:3[7] - tabby # file.yml:4[7] other: # file.yml:5[1] things: # file.yml:6[5] green: # file.yml:8[9] - grass # unknown - ground # file.yml:10[15] red: balloons # file.yml:7[14] trending: now # file.yml:12[15]
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrEncoding = errors.New("encoding error")
)
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct{}
Encoder is a class for the yaml encoder.
func (Encoder) EncodeExtended ¶
Encode encodes the meta.Object provided into yaml with comments showing the origin of the configuration and returns the bytes.
func (Encoder) Extensions ¶
Extensions returns the supported extensions.