package yaml

import "cuelang.org/go/internal/third_party/yaml"

Package yaml implements YAML support for the Go language.

Source code and other details for the project are available at GitHub:

https://github.com/go-yaml/yaml

Index

Functions

func Unmarshal

func Unmarshal(filename string, in []byte) (expr ast.Expr, err error)

Unmarshal decodes the first document found within the in byte slice and returns it as a CUE syntax AST.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

A Decoder reads and decodes YAML values from an input stream.

func NewDecoder

func NewDecoder(filename string, src interface{}) (*Decoder, error)

NewDecoder returns a new decoder that reads from r.

The decoder introduces its own buffering and may read data from r beyond the YAML values requested.

func (*Decoder) Decode

func (dec *Decoder) Decode() (expr ast.Expr, err error)

Decode reads the next YAML-encoded value from its input and returns it as CUE syntax. It returns io.EOF if there are no more value in the stream.

type TypeError

type TypeError struct {
	Errors []string
}

A TypeError is returned by Unmarshal when one or more fields in the YAML document cannot be properly decoded into the requested types. When this error is returned, the value is still unmarshaled partially.

func (*TypeError) Error

func (e *TypeError) Error() string

Source Files

apic.go decode.go parserc.go readerc.go resolve.go scannerc.go yaml.go yamlh.go yamlprivateh.go

Version
v0.8.0
Published
Mar 15, 2024
Platform
js/wasm
Imports
17 packages
Last checked
43 minutes ago

Tools for package owners.