Documentation ¶
Overview ¶
Package yaml provides tools for encoding and decoding YAML.
Index ¶
- Variables
- func Convert[O, I any](obj I) (o O, err error)
- type Decoder
- func (d *Decoder) Decode(obj any) error
- func (d *Decoder) DecodeToUnstructured(visitFunc func(obj *unstructured.Unstructured) error) error
- func (d *Decoder) DecodeUnstructured() (*unstructured.Unstructured, error)
- func (d *Decoder) UndecodedUnstructured(obj *unstructured.Unstructured)
- func (d *Decoder) WithErrorHandler(handler func(error) error) *Decoder
- type Encoder
Constants ¶
This section is empty.
Variables ¶
View Source
var ( YAMLToJSON = yaml.YAMLToJSON JSONToYAML = yaml.JSONToYAML Unmarshal = yaml.Unmarshal Marshal = yaml.Marshal )
The following functions are exported for testing purposes only.
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is a YAML decoder.
func (*Decoder) DecodeToUnstructured ¶ added in v0.4.0
func (d *Decoder) DecodeToUnstructured(visitFunc func(obj *unstructured.Unstructured) error) error
DecodeToUnstructured decodes YAML into a list of unstructured objects.
func (*Decoder) DecodeUnstructured ¶ added in v0.5.0
func (d *Decoder) DecodeUnstructured() (*unstructured.Unstructured, error)
DecodeUnstructured decodes YAML into an unstructured object.
func (*Decoder) UndecodedUnstructured ¶ added in v0.5.0
func (d *Decoder) UndecodedUnstructured(obj *unstructured.Unstructured)
UndecodedUnstructured put a decoded unstructured object back to the decoder.
Click to show internal directories.
Click to hide internal directories.