jsonnet锛屽氨杩欎箞绁炲

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jsonnet锛屽氨杩欎箞绁炲相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/https' title='https'>https   mint   die   init   alt   c++   html   jit   nis   

鏃㈢劧瑕佺帺kube-prometheus锛?/p>

jsonnet锛屼篃闄勫甫鐫€鐜╃帺鍟︺€傘€?/p>

https://jsonnet.org/learning/tutorial.html

鎴戠敤鐨勬槸Golang鏉ョ帺鐨勶紝涓嶆槸C++鐗堟湰鐨勩€?/p>

https://github.com/google/go-jsonnet

 

example.jsonnet

// A regular definition.
local house_rum = 鈥楤anks Rum鈥?

{
  // A definition next to fields.
  local pour = 1.5,

  Daiquiri: {
    ingredients: [
      { kind: house_rum, qty: pour },
      { kind: 鈥楲ime鈥? qty: 1 },
      { kind: 鈥楽imple Syrup鈥? qty: 0.5 },
    ],
    served: 鈥楽traight Up鈥?
  },
  Mojito: {
    ingredients: [
      {
        kind: 鈥楳int鈥?
        action: 鈥榤uddle鈥?
        qty: 6,
        unit: 鈥榣eaves鈥?
      },
      { kind: house_rum, qty: pour },
      { kind: 鈥楲ime鈥? qty: 0.5 },
      { kind: 鈥楽imple Syrup鈥? qty: 0.5 },
      { kind: 鈥楽oda鈥? qty: 3 },
    ],
    garnish: 鈥楲ime wedge鈥?
    served: 鈥極ver crushed ice鈥?
  },
}

銆€銆€

鍛戒护锛?/p>

jsonnet.exe example.jsonnet

杈撳嚭

鎶€鏈浘鐗? src=

{
   "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"
   }
}

銆€銆€

以上是关于jsonnet锛屽氨杩欎箞绁炲的主要内容,如果未能解决你的问题,请参考以下文章

娣卞叆婧愮爜鍒嗘瀽锛岀紦瀛樹箣鐜?Caffeine 涓轰綍杩欎箞鐚?

Soild鎬ц兘灞呯劧杩欎箞鍘夊锛孷ue銆丷eact鍜孉ngular绔熺悍绾疯穼鍑哄墠鍗?/h1>

Flink 鐏甸瓊涓ょ櫨闂紝杩欒皝椤跺緱浣忥紵