package yaml

import "cuelang.org/go/pkg/encoding/yaml"

Index

Functions

func Marshal

func Marshal(v cue.Value) (string, error)

Marshal returns the YAML encoding of v.

func MarshalStream

func MarshalStream(v cue.Value) (string, error)

MarshalStream returns the YAML encoding of v.

func Unmarshal

func Unmarshal(data []byte) (ast.Expr, error)

Unmarshal parses the YAML to a CUE instance.

func Validate

func Validate(b []byte, v cue.Value) (bool, error)

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

func ValidatePartial

func ValidatePartial(b []byte, v cue.Value) (bool, error)

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.4.1-beta.4
Published
Dec 1, 2021
Platform
linux/amd64
Imports
9 packages
Last checked
16 minutes ago

Tools for package owners.