yaml

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2019 License: Apache-2.0 Imports: 6 Imported by: 50

Documentation

Overview

Package yaml converts YAML encodings to and from CUE. When converting to CUE, comments and position information are retained.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r *cue.Runtime, filename string, src interface{}) (*cue.Instance, error)

Decode converts a YAML file to a CUE value. Streams are returned as a list of the streamed values.

func Encode

func Encode(v cue.Value) ([]byte, error)

Encode returns the YAML encoding of v.

func EncodeStream

func EncodeStream(iter cue.Iterator) ([]byte, error)

EncodeStream returns the YAML encoding of iter, where consecutive values of iter are separated with a `---`.

func Extract

func Extract(filename string, src interface{}) (*ast.File, error)

Extract parses the YAML to a CUE expression. Streams are returned as a list of the streamed values.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL