Documentation ¶
Index ¶
- func ConvertObjectToMap(obj *astext.Object) (map[string]interface{}, error)
- func DecodeValue(s string) (interface{}, error)
- func FieldID(field astext.ObjectField) (string, error)
- func FindObject(object *astext.Object, path []string) (*astext.Object, error)
- func HasField(object *astext.Object, name string) bool
- func Import(filename string) (*astext.Object, error)
- func ImportFromFs(filename string, fs afero.Fs) (*astext.Object, error)
- func ImportNodeFromFs(filename string, fs afero.Fs) (ast.Node, error)
- func Parse(filename, src string) (*astext.Object, error)
- func ParseNode(filename, src string) (ast.Node, error)
- func Set(object *astext.Object, path []string, value ast.Node) error
- type AferoImporter
- type FileImporter
- type Importer
- type VM
- func (vm *VM) AddFunctions(fns ...*jsonnet.NativeFunction)
- func (vm *VM) AddJPath(paths ...string)
- func (vm *VM) EvaluateSnippet(name, snippet string) (string, error)
- func (vm *VM) ExtCode(key, value string)
- func (vm *VM) ExtVar(key, value string)
- func (vm *VM) TLACode(key, value string)
- func (vm *VM) TLAVar(key, value string)
- type VMOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertObjectToMap ¶
ConvertObjectToMap converts an object to a map.
func DecodeValue ¶
DecodeValue decodes a string to an interface value. nolint: gocyclo
func FieldID ¶
func FieldID(field astext.ObjectField) (string, error)
FieldID returns the id for an object field.
func FindObject ¶
FindObject finds a path in an object.
func ImportFromFs ¶
ImportFromFs imports jsonnet object from a path on an afero filesystem.
func ImportNodeFromFs ¶
ImportNodeFromFs imports jsonnet node from a path on an afero filesystem.
Types ¶
type AferoImporter ¶ added in v0.12.0
type AferoImporter struct { FileImporter Fs afero.Fs }
AferoImporter implements Importer using an afero Fs interface.
type FileImporter ¶ added in v0.12.0
type FileImporter struct {
jsonnet.FileImporter
}
FileImporter extends jsonnet.FileImporter to allow incrementally adding import paths.
func (*FileImporter) AddJPath ¶ added in v0.12.0
func (f *FileImporter) AddJPath(paths ...string)
AddJPath adds the provided paths to the importer.
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
VM is a ksonnet wrapper for the jsonnet VM.
func (*VM) AddFunctions ¶ added in v0.12.0
func (vm *VM) AddFunctions(fns ...*jsonnet.NativeFunction)
AddFunctions adds native functions to the Jsonnet VM.
func (*VM) EvaluateSnippet ¶
EvaluateSnippet evaluates a jsonnet snippet.
type VMOpt ¶
type VMOpt func(*VM)
VMOpt is an option for configuring VM.
func AferoImporterOpt ¶ added in v0.12.0
AferoImporterOpt configures a VM with a jsonnet.Importer
func ImporterOpt ¶ added in v0.12.0
ImporterOpt configures a VM with a jsonnet.Importer