{"id":13560891,"url":"https://github.com/strickyak/jsonnet_cgo","last_synced_at":"2025-04-03T16:31:23.090Z","repository":{"id":25156193,"uuid":"28578973","full_name":"strickyak/jsonnet_cgo","owner":"strickyak","description":"Golang CGo Wrapper around JSonnet VM","archived":false,"fork":false,"pushed_at":"2019-07-04T00:44:01.000Z","size":397,"stargazers_count":16,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-04T12:40:03.591Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strickyak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-29T03:27:33.000Z","updated_at":"2022-07-25T06:00:53.000Z","dependencies_parsed_at":"2022-08-23T19:40:50.836Z","dependency_job_id":null,"html_url":"https://github.com/strickyak/jsonnet_cgo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strickyak%2Fjsonnet_cgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strickyak%2Fjsonnet_cgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strickyak%2Fjsonnet_cgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strickyak%2Fjsonnet_cgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strickyak","download_url":"https://codeload.github.com/strickyak/jsonnet_cgo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247037004,"owners_count":20873076,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:00:50.572Z","updated_at":"2025-04-03T16:31:22.255Z","avatar_url":"https://github.com/strickyak.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# `jsonnet_cgo`\n\nSimple golang cgo wrapper around JSonnet VM.\n\nEverything in libjsonnet.h is covered except the multi-file evaluators.\n\nSee jsonnet_test.go for how to use it.\n\n## Quick example in golang:\n\n        vm := jsonnet.Make()\n        vm.ExtVar(\"color\", \"purple\")\n\n        x, err := vm.EvaluateSnippet(`Test_Demo`, `\"dark \" + std.extVar(\"color\")`)\n\n        if err != nil {\n                panic(err)\n        }\n        if x != \"\\\"dark purple\\\"\\n\" {\n                panic(\"fail: we got \" + x)\n        }\n\n        vm.Destroy()\n\n## Quick examples with the command line demo program:\n\n```\n$ ( cd jsonnet_main/  ; go  build -x -a )\n...\nmv $WORK/b001/exe/a.out jsonnet_main\n...\n$ echo \"{ a: 1, b: 2 }\"  | jsonnet_main/jsonnet_main /dev/stdin\n{\n   \"a\": 1,\n   \"b\": 2\n}\n$ cat test1.j\n{\n  shell: \"/bin/sh\",\n  awk: \"/usr/bin/awk\",\n}\n$ jsonnet_main/jsonnet_main test1.j\n{\n   \"awk\": \"/usr/bin/awk\",\n   \"shell\": \"/bin/sh\"\n}\n$ cat test2.j\nlocal test1 = import \"test1.j\";\n\ntest1 {\n  shell: \"/bin/csh\",\n}\n$ jsonnet_main/jsonnet_main test2.j\n{\n   \"awk\": \"/usr/bin/awk\",\n   \"shell\": \"/bin/csh\"\n}\n$ echo ' std.extVar(\"a\") + \"bar\" ' | jsonnet_main/jsonnet_main /dev/stdin a=foo\n\"foobar\"\n```\n\n## LICENSES\n\nNotice the various `LICENSE*` files.  I cannot offer legal advice,\nbut you might find that the Apache License is the most restrictive.\n\nMost of this code comes from https://github.com/google/jsonnet\nand is under the Apache License, Version 2.0, January 2004,\nand our files that match filenames there are under that license.\n\nNotice the `third_party/` directory in that distribution.\nIt has `json/` and `md5/` under their own licences, and our files\nthat match filenames there are under those licenses.\n\nAnything new added here is under an MIT license in the plain `LICENSE` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrickyak%2Fjsonnet_cgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrickyak%2Fjsonnet_cgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrickyak%2Fjsonnet_cgo/lists"}