Documentation
¶
Index ¶
- Variables
- func DecodeAndValidate(r io.Reader, v interface{}) error
- func Marshal(v interface{}) ([]byte, error)
- func PreProcess(data []byte) ([]byte, error)
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalStrict(data []byte, v interface{}) error
- type Decoder
- type Encoder
- type MapItem
- type MapSlice
- type Marshaler
- type Node
- type TypeError
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
var StrictSyntax bool
StrictSyntax determines if pre-processing directives should be observed
Functions ¶
func DecodeAndValidate ¶
DecodeAndValidate is a wrapper for yaml Decode adding struct validation
func Unmarshal ¶ added in v3.10.0
Unmarshal deserializes YAML using yaml.v2-compatible lax duplicate-key behavior. In lax mode yaml.v2 allowed duplicate mapping keys and kept the last value; yaml.v3 rejects duplicates by default, so normalize first.
func UnmarshalStrict ¶ added in v3.10.0
UnmarshalStrict deserializes YAML and rejects unknown struct fields and duplicate mapping keys.
Types ¶
type Decoder ¶ added in v3.10.0
type Decoder struct {
// contains filtered or unexported fields
}
Decoder reads YAML documents.
func NewDecoder ¶ added in v3.10.0
NewDecoder returns a YAML decoder.
func (*Decoder) KnownFields ¶ added in v3.10.0
KnownFields matches yaml.v3's decoder API.
type Encoder ¶ added in v3.10.0
Encoder writes YAML documents.
func NewEncoder ¶ added in v3.10.0
NewEncoder returns a YAML encoder.
type MapItem ¶ added in v3.10.0
type MapItem struct {
Key interface{}
Value interface{}
}
MapItem is a single YAML mapping item.
type MapSlice ¶ added in v3.10.0
type MapSlice []MapItem
MapSlice preserves mapping key order for compatibility with yaml.v2.
func (*MapSlice) UnmarshalYAML ¶ added in v3.10.0
UnmarshalYAML decodes an ordered map from a yaml.v3 node.
type Marshaler ¶ added in v3.10.0
type Marshaler interface {
MarshalYAML() (interface{}, error)
}
Marshaler is the YAML marshaling interface used by the project.
type Unmarshaler ¶ added in v3.10.0
Unmarshaler is the legacy callback-style YAML unmarshaling interface used throughout nuclei. yaml.v3 still supports this shape, but does not export it.