github.com/solo-io/cue@v0.4.7/encoding/protobuf/textproto/testdata/decoder/simple.txtar (about)

     1  // From: https://stackoverflow.com/questions/18873924/what-does-the-protobuf-text-format-look-like
     2  -- foo.cue --
     3  #MyEnum: "Default" | "Variant1" | "Variant100"
     4  
     5  f1:       string
     6  f2:       int64
     7  fa:       [...uint64]
     8  fb:       [...int32]
     9  fc:       [...number]
    10  pairs:    [...#Pair]
    11  bbbb:     bytes // optional
    12  
    13  //    extensions 100 to max;
    14  
    15  #Pair: {
    16      key:   string
    17      value: string
    18  }
    19  
    20  -- input.textproto --
    21  f1: "dsfadsafsaf"
    22  f2: 234 # value comment
    23  
    24  fa: 2342134
    25  fa: 2342135
    26  fa: 2342136
    27  # Mix of list and single elements.
    28  fb: [ -2342134, -2342135, -2342136 ]
    29  fb: -1000
    30  
    31  fc: 4
    32  fc: 7
    33  fc: -12
    34  fc: 4
    35  fc: 7
    36  fc: -3
    37  fc: 4
    38  fc: 7
    39  fc: 0
    40  pairs {
    41      key: "sdfff"
    42      value: "q\"qq\\q\n"
    43  }
    44  pairs {
    45      key: "   sdfff2  \321\202\320\265\321\201\321\202 "
    46      value: "q\tqq<>q2&\001\377"
    47  }
    48  bbbb: "\000\001\002\377\376\375"
    49  -- out/decode --
    50  f1: "dsfadsafsaf"
    51  f2: 234 // value comment
    52  fa: [2342134, 2342135, 2342136]
    53  // Mix of list and single elements.
    54  fb: [-2342134, -2342135, -2342136, -1000]
    55  fc: [4, 7, -12, 4, 7, -3, 4, 7, 0]
    56  pairs: [{
    57  	key:   "sdfff"
    58  	value: "q\"qq\\q\n"
    59  }, {
    60  	key:   "   sdfff2  тест "
    61  	value: "q\tqq<>q2&\u0001�"
    62  }]
    63  bbbb: '\x00\x01\x02\xff\xfe\xfd'