natives

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseJSON

func ParseJSON(reader io.Reader) (interface{}, error)

ParseJSON parses the contents of the reader into a data object and returns it.

func ParseYAMLDocuments

func ParseYAMLDocuments(reader io.Reader) ([]interface{}, error)

ParseYAMLDocuments parses the contents of the reader into an array of objects, one for each non-nil document in the input.

func Register

func Register(vm *jsonnet.VM)

Register adds qbec's native jsonnet functions to the provided VM

func RenderYAMLDocuments

func RenderYAMLDocuments(data interface{}, writer io.Writer) (retErr error)

RenderYAMLDocuments renders the supplied data as a series of YAML documents if the input is an array or a single document when it is not. Nils are excluded from output. If the caller wants an array to be rendered as a single document, they need to wrap it in an array first. Note that this function is not a drop-in replacement for data that requires ghodss/yaml to be rendered correctly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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