jsonnet

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Evaluate

func Evaluate(sonnet string, jpath []string, mods ...Modifier) (string, error)

Evaluate renders the given jsonnet into a string

func EvaluateFile

func EvaluateFile(jsonnetFile string, mods ...Modifier) (string, error)

EvaluateFile opens the file, reads it into memory and evaluates it afterwards (`Evaluate()`)

func TransitiveImports

func TransitiveImports(dir string) ([]string, error)

TransitiveImports returns all recursive imports of an environment

Types

type ExtendedImporter added in v0.6.0

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

ExtendedImporter wraps jsonnet.FileImporter to add additional functionality: - `import "file.yaml"` - `import "tk"`

func NewExtendedImporter added in v0.6.0

func NewExtendedImporter(jpath []string) *ExtendedImporter

NewExtendedImporter returns a new instance of ExtendedImporter with the correct jpaths set up

func (*ExtendedImporter) Import added in v0.6.0

func (i *ExtendedImporter) Import(importedFrom, importedPath string) (contents jsonnet.Contents, foundAt string, err error)

Import implements the functionality offered by the ExtendedImporter

type Modifier added in v0.7.0

type Modifier func(vm *jsonnet.VM) error

Modifiers allow to set optional paramters on the Jsonnet VM. See jsonnet.With* for this.

func WithExtCode added in v0.7.0

func WithExtCode(key, code string) Modifier

WithExtCode allows to make the supplied snippet available to Jsonnet as an ext var

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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