package yaml
import "cuelang.org/go/pkg/encoding/yaml"
Index ¶
- func Marshal(v cue.Value) (string, error)
- func MarshalStream(v cue.Value) (string, error)
- func Unmarshal(data []byte) (ast.Expr, error)
- func UnmarshalStream(data []byte) (ast.Expr, error)
- func Validate(b []byte, v pkg.Schema) (bool, error)
- func ValidatePartial(b []byte, v pkg.Schema) (bool, error)
Functions ¶
func Marshal ¶
Marshal returns the YAML encoding of v.
func MarshalStream ¶
MarshalStream returns the YAML encoding of v.
func Unmarshal ¶
Unmarshal parses the YAML to a CUE expression.
func UnmarshalStream ¶
UnmarshalStream parses the YAML to a CUE list expression on success.
func Validate ¶
Validate validates YAML and confirms it is an instance of schema. If the YAML source is a stream, every object must match v.
func ValidatePartial ¶
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.
Source Files ¶
manual.go pkg.go
- Version
- v0.12.0 (latest)
- Published
- Jan 30, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 8 hours ago –
Tools for package owners.