Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Evaluate ¶
Evaluate renders the given jsonnet into a string If cache options are given, a hash from the data will be computed and
the resulting string will be cached for future retrieval
func EvaluateFile ¶
EvaluateFile evaluates the Jsonnet code in the given file and returns the result in JSON form. It disregards opts.ImportPaths in favor of automatically resolving these according to the specified file.
func MakeVM ¶ added in v0.12.0
MakeVM returns a Jsonnet VM with some extensions of Tanka, including: - extended importer - extCode and tlaCode applied - native functions registered
func TransitiveImports ¶
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
type FileEvalCache ¶ added in v0.18.0
type FileEvalCache struct {
Directory string
}
FileEvalCache is an evaluation cache that stores its data on the local filesystem
func NewFileEvalCache ¶ added in v0.18.0
func NewFileEvalCache(cachePath string) *FileEvalCache
func (*FileEvalCache) Get ¶ added in v0.18.0
func (c *FileEvalCache) Get(hash string) (string, error)
func (*FileEvalCache) Store ¶ added in v0.18.0
func (c *FileEvalCache) Store(hash, content string) error
type InjectedCode ¶ added in v0.12.0
InjectedCode holds data that is "late-bound" into the VM
func (*InjectedCode) Set ¶ added in v0.12.0
func (i *InjectedCode) Set(key, value string)
Set allows to set values on an InjectedCode, even when it is nil
type Modifier ¶ added in v0.7.0
Modifier allows to set optional parameters on the Jsonnet VM. See jsonnet.With* for this.
type Opts ¶ added in v0.12.0
type Opts struct { ExtCode InjectedCode TLACode InjectedCode ImportPaths []string EvalScript string CachePath string CachePathRegexes []*regexp.Regexp }
Opts are additional properties for the Jsonnet VM
func (Opts) PathIsCached ¶ added in v0.18.0
PathIsCached determines if a given path is matched by any of the configured cached path regexes If no path regexes are defined, all paths are matched