vmexternals

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromCommandParams

func FromCommandParams(cmd *cobra.Command, prefix string, addShortcuts bool) func() (Externals, error)

FromCommandParams attaches VM related flags to the specified command and returns a function that provides the config based on command line flags.

Types

type Externals

type Externals struct {
	Variables   UserVariables // variables specified on command line
	LibPaths    []string      // library paths in filesystem for the file importer
	DataSources []string      // data sources defined on the command line
}

Externals is the desired configuration of the Jsonnet VM as specified by the user.

func (Externals) ToVariableSet

func (c Externals) ToVariableSet() vm.VariableSet

ToVariableSet adapts the supplied set of user variables to a VM variable set.

func (Externals) WithLibPaths

func (c Externals) WithLibPaths(paths []string) Externals

WithLibPaths returns a config with additional library paths.

type UserVal

type UserVal struct {
	Value string // variable value
	Code  bool   // whether the value should be treated as jsonnet code
}

UserVal is a user-supplied variable value to be initialized for the jsonnet VM

type UserVariables

type UserVariables struct {
	Vars         map[string]UserVal // variables keyed by name
	TopLevelVars map[string]UserVal // TLA string vars keyed by name
}

UserVariables is a set of user-provided variables to be registered with a jsonnet VM

Jump to

Keyboard shortcuts

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