标签:https mint die init alt c++ html jit nis
既然要玩kube-prometheus,
jsonnet,也附带着玩玩啦。。
https://jsonnet.org/learning/tutorial.html
我用的是Golang来玩的,不是C++版本的。
https://github.com/google/go-jsonnet
example.jsonnet
// A regular definition.
local house_rum = ‘Banks Rum‘;
{
// A definition next to fields.
local pour = 1.5,
Daiquiri: {
ingredients: [
{ kind: house_rum, qty: pour },
{ kind: ‘Lime‘, qty: 1 },
{ kind: ‘Simple Syrup‘, qty: 0.5 },
],
served: ‘Straight Up‘,
},
Mojito: {
ingredients: [
{
kind: ‘Mint‘,
action: ‘muddle‘,
qty: 6,
unit: ‘leaves‘,
},
{ kind: house_rum, qty: pour },
{ kind: ‘Lime‘, qty: 0.5 },
{ kind: ‘Simple Syrup‘, qty: 0.5 },
{ kind: ‘Soda‘, qty: 3 },
],
garnish: ‘Lime wedge‘,
served: ‘Over crushed ice‘,
},
}
命令:
jsonnet.exe example.jsonnet
输出

{
"Daiquiri": {
"ingredients": [
{
"kind": "Banks Rum",
"qty": 1.5
},
{
"kind": "Lime",
"qty": 1
},
{
"kind": "Simple Syrup",
"qty": 0.5
}
],
"served": "Straight Up"
},
"Mojito": {
"garnish": "Lime wedge",
"ingredients": [
{
"action": "muddle",
"kind": "Mint",
"qty": 6,
"unit": "leaves"
},
{
"kind": "Banks Rum",
"qty": 1.5
},
{
"kind": "Lime",
"qty": 0.5
},
{
"kind": "Simple Syrup",
"qty": 0.5
},
{
"kind": "Soda",
"qty": 3
}
],
"served": "Over crushed ice"
}
}
标签:https mint die init alt c++ html jit nis
原文地址:https://www.cnblogs.com/aguncn/p/12527263.html