yaml

package
v0.0.0-...-737bdf4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotMaps = errors.New("map merge requires map or sequence of maps as the value")

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	KeyMarshal func(interface{}) ([]byte, error)

	// If set, NaN, Inf, etc. are replaced by the set values
	NaN, PosInf, NegInf          interface{}
	KeyNaN, KeyPosInf, KeyNegInf interface{}
}

func (*Decoder) Decode

func (d *Decoder) Decode(node *goyaml.Node) (normal interface{}, err error)

Decode decodes a YAML node tree into an the normalized object format.

type Encoder

type Encoder struct {
	KeyUnmarshal func([]byte, interface{}) error

	// If set, the set values will be converted to NaN, Inf, etc.
	NaN, PosInf, NegInf          interface{}
	KeyNaN, KeyPosInf, KeyNegInf interface{}
}

func (*Encoder) Encode

func (e *Encoder) Encode(normal interface{}) (yaml interface{}, err error)

Encode encodes the normalized object format into a suitable format for marshaling to YAML.

type KeyJSON

type KeyJSON struct {
	EscapeHTML bool
}

func (*KeyJSON) Marshal

func (k *KeyJSON) Marshal(v interface{}) ([]byte, error)

func (*KeyJSON) Unmarshal

func (k *KeyJSON) Unmarshal(src []byte, v interface{}) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL