cuelang.org/go@v0.13.0/cue/testdata/export/022.txtar (about)

     1  raw: true
     2  eval: true
     3  noOpt: true
     4  -- in.cue --
     5  {
     6  	job: [Name=_]: {
     7  		name:     Name
     8  		replicas: uint | *1 @protobuf(10)
     9  		command:  string
    10  	}
    11  
    12  	job: list: command: "ls"
    13  
    14  	job: nginx: {
    15  		command:  "nginx"
    16  		replicas: 2
    17  	}
    18  }
    19  -- out/def --
    20  job: {
    21  	{[Name=string]: {
    22  		name: Name, replicas: >=0 | *1 @protobuf(10), command: string
    23  	}}
    24  	list: {
    25  		name:     "list"
    26  		replicas: >=0 | *1 @protobuf(10)
    27  		command:  "ls"
    28  	}
    29  	nginx: {
    30  		name:     "nginx"
    31  		replicas: 2 @protobuf(10)
    32  		command:  "nginx"
    33  	}
    34  }
    35  -- out/export --
    36  job: {
    37  	list: {
    38  		name:     "list"
    39  		replicas: 1 @protobuf(10)
    40  		command:  "ls"
    41  	}
    42  	nginx: {
    43  		name:     "nginx"
    44  		replicas: 2 @protobuf(10)
    45  		command:  "nginx"
    46  	}
    47  }
    48  -- out/yaml --
    49  job:
    50    list:
    51      name: list
    52      replicas: 1
    53      command: ls
    54    nginx:
    55      name: nginx
    56      replicas: 2
    57      command: nginx
    58  -- out/json --
    59  {"job":{"list":{"name":"list","replicas":1,"command":"ls"},"nginx":{"name":"nginx","replicas":2,"command":"nginx"}}}
    60  -- out/compile --
    61  --- in.cue
    62  {
    63    {
    64      job: {
    65        [_]: {
    66          name: 〈1;-〉
    67          replicas: (&(int, >=0)|*1)
    68          command: string
    69        }
    70      }
    71      job: {
    72        list: {
    73          command: "ls"
    74        }
    75      }
    76      job: {
    77        nginx: {
    78          command: "nginx"
    79          replicas: 2
    80        }
    81      }
    82    }
    83  }
    84  -- out/eval/stats --
    85  Leaks:  0
    86  Freed:  14
    87  Reused: 8
    88  Allocs: 6
    89  Retain: 0
    90  
    91  Unifications: 10
    92  Conjuncts:    22
    93  Disjuncts:    14
    94  -- out/eval --
    95  (struct){
    96    job: (struct){
    97      list: (struct){
    98        command: (string){ "ls" }
    99        name: (string){ "list" }
   100        replicas: (int){ |(*(int){ 1 }, (int){ &(>=0, int) }) }
   101      }
   102      nginx: (struct){
   103        command: (string){ "nginx" }
   104        replicas: (int){ 2 }
   105        name: (string){ "nginx" }
   106      }
   107    }
   108  }