package yaml
import "cuelang.org/go/encoding/yaml"
Package yaml converts YAML encodings to and from CUE. When converting to CUE, comments and position information are retained.
Index ¶
- func Decode(r *cue.Runtime, filename string, src interface{}) (*cue.Instance, error)
- func Encode(v cue.Value) ([]byte, error)
- func EncodeStream(iter cue.Iterator) ([]byte, error)
- func Extract(filename string, src interface{}) (*ast.File, error)
- func Validate(b []byte, v cue.Value) error
Functions ¶
func Decode ¶
Decode converts a YAML file to a CUE value. Streams are returned as a list of the streamed values.
func Encode ¶
Encode returns the YAML encoding of v.
func EncodeStream ¶
EncodeStream returns the YAML encoding of iter, where consecutive values of iter are separated with a `---`.
func Extract ¶
Extract parses the YAML to a CUE expression. Streams are returned as a list of the streamed values.
func Validate ¶
Validate validates the YAML and confirms it matches the constraints specified by v. For YAML streams, all values must match v.
Source Files ¶
yaml.go
- Version
- v0.3.0-alpha5
- Published
- Nov 21, 2020
- Platform
- windows/amd64
- Imports
- 7 packages
- Last checked
- 49 minutes ago –
Tools for package owners.