encoding/yaml

CUE v0.18.0

Functions

Marshal

cue
Marshal: func(v: _) -> string

Marshal returns the YAML encoding of v.

MarshalStream

cue
MarshalStream: func(v: _) -> string

MarshalStream returns the YAML encoding of v.

Unmarshal

cue
Unmarshal: func(data: bytes | string) -> _

Unmarshal parses the YAML to a CUE expression.

UnmarshalStream

cue
UnmarshalStream: func(data: bytes | string) -> _

UnmarshalStream parses the YAML to a CUE list expression on success.

Validate validator

validator form

cue
func(v: _ @schema()) -> validator(bytes | string)

call form

cue
func(b: bytes | string, v: _ @schema()) -> bool

Validate validates YAML and confirms it is an instance of schema. If the YAML source is a stream, every object must match v.

ValidatePartial validator

validator form

cue
func(v: _ @schema()) -> validator(bytes | string)

call form

cue
func(b: bytes | string, v: _ @schema()) -> bool

ValidatePartial validates YAML and confirms it matches the constraints specified by v using unification. This means that b must be consistent with, but does not have to be an instance of v. If the YAML source is a stream, every object must match v.

Install CUE