Golang CGo Wrapper around JSonnet VM
C++ C Go Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
jsonnet_main
stress_loop
.gitignore
COMPARE-jsonnet.sh
LICENSE
LICENSE.jsonnet
LICENSE.md5
README.md
ast.h
bridge.c
desugarer.cpp
desugarer.h
formatter.cpp
formatter.h
json.h
jsonnet.go
jsonnet_test.go
lexer.cpp
lexer.h
libjsonnet.cpp
libjsonnet.h
md5.cpp
md5.h
parser.cpp
parser.h
pass.cpp
pass.h
state.h
static_analysis.cpp
static_analysis.h
static_error.h
std.jsonnet.h
string_utils.cpp
string_utils.h
test1.j
test2.j
unicode.h
vm.cpp
vm.h

README.md

jsonnet_cgo

Simple golang cgo wrapper around JSonnet VM.

Everything in libjsonnet.h is covered except the multi-file evaluators.

See jsonnet_test.go for how to use it.

Quick example:

    vm := jsonnet.Make()
    vm.ExtVar("color", "purple")

    x, err := vm.EvaluateSnippet(`Test_Demo`, `"dark " + std.extVar("color")`)

    if err != nil {
            panic(err)
    }
    if x != "\"dark purple\"\n" {
            panic("fail: we got " + x)
    }

    vm.Destroy()