jsonnet

package
v0.10.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: Apache-2.0 Imports: 11 Imported by: 50

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldID

func FieldID(field astext.ObjectField) (string, error)

FieldID returns the id for an object field.

func FindObject

func FindObject(object *astext.Object, path []string) (*astext.Object, error)

FindObject finds a path in an object.

func Import

func Import(filename string) (*astext.Object, error)

Import imports jsonnet from a path.

func ImportFromFs

func ImportFromFs(filename string, fs afero.Fs) (*astext.Object, error)

ImportFromFs imports jsonnet from a path on an afero filesystem.

func Parse

func Parse(filename, src string) (*astext.Object, error)

Parse converts a jsonnet snippet to AST Object.

func ParseNode

func ParseNode(filename, src string) (ast.Node, error)

ParseNode converts a jsonnet snippet to AST node.

func Set

func Set(object *astext.Object, path []string, value ast.Node) error

Set sets an object key at path to a value.

Types

type VM

type VM struct {
	// JPaths are jsonnet library paths
	JPaths []string
	// UseMemoryImporter forces the vm to use a memory importer rather than the
	// file import.
	UseMemoryImporter bool
	Fs                afero.Fs
	// contains filtered or unexported fields
}

VM is a ksonnet wrapper for the jsonnet VM.

func NewVM

func NewVM(opts ...VMOpt) *VM

NewVM creates an instance of VM.

func (*VM) EvaluateSnippet

func (vm *VM) EvaluateSnippet(name, snippet string) (string, error)

EvaluateSnippet evaluates a jsonnet snippet.

func (*VM) ExtCode

func (vm *VM) ExtCode(key, value string)

ExtCode sets ExtCode for the jsonnet VM.

func (*VM) TLACode

func (vm *VM) TLACode(key, value string)

TLACode sets TLACode for the jsonnet VM.

func (*VM) TLAVar

func (vm *VM) TLAVar(key, value string)

TLAVar sets TLAVar for the jsonnet VM.

type VMOpt

type VMOpt func(*VM)

VMOpt is an option for configuring VM.

Jump to

Keyboard shortcuts

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