cuelang.org/go@v0.10.1/encoding/protobuf/testdata/attributes.proto.out.cue (about)

     1  // Copyright 2016 Istio Authors
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  package v1
    15  
    16  import (
    17  	"time"
    18  	"googleapis.com/acme/test"
    19  	"googleapis.com/acme/test/test:test_test"
    20  	time_1 "time"
    21  )
    22  
    23  #StructWrap: {
    24  	struct?: {} @protobuf(1,google.protobuf.Struct)
    25  	any?: _ @protobuf(2,google.protobuf.Value)
    26  	listVal?: [...] @protobuf(3,google.protobuf.ListValue)
    27  	boolVal?:   bool   @protobuf(4,google.protobuf.BoolValue)
    28  	stringVal?: string @protobuf(5,google.protobuf.StringValue)
    29  	numberVal?: number @protobuf(6,google.protobuf.NumberValue)
    30  }
    31  
    32  // Attributes represents a set of typed name/value pairs. Many of Mixer's
    33  // API either consume and/or return attributes.
    34  //
    35  // Istio uses attributes to control the runtime behavior of services running in the service mesh.
    36  // Attributes are named and typed pieces of metadata describing ingress and egress traffic and the
    37  // environment this traffic occurs in. An Istio attribute carries a specific piece
    38  // of information such as the error code of an API request, the latency of an API request, or the
    39  // original IP address of a TCP connection. For example:
    40  //
    41  // ```yaml
    42  // request.path: xyz/abc
    43  // request.size: 234
    44  // request.time: 12:34:56.789 04/17/2017
    45  // source.ip: 192.168.0.1
    46  // target.service: example
    47  // ```
    48  //
    49  #Attributes: {
    50  	// A map of attribute name to its value.
    51  	attributes?: {
    52  		[string]: #AttributeValue
    53  	} @protobuf(1,map[string]AttributeValue)
    54  
    55  	// Specifies one attribute value with different type.
    56  	#AttributeValue: {
    57  		// The attribute value.
    58  		{} | {
    59  			// Used for values of type STRING, DNS_NAME, EMAIL_ADDRESS, and URI
    60  			stringValue: string @protobuf(2,string,name=string_value)
    61  		} | {
    62  			// Used for values of type INT64
    63  			int64Value: int64 @protobuf(3,int64,name=int64_value)
    64  		} | {
    65  			// Used for values of type DOUBLE
    66  			doubleValue: float64 @protobuf(4,double,name=double_value)
    67  		} | {
    68  			// Used for values of type BOOL
    69  			boolValue: bool @protobuf(5,bool,name=bool_value)
    70  		} | {
    71  			// Used for values of type BYTES
    72  			bytesValue: bytes @protobuf(6,bytes,name=bytes_value)
    73  		} | {
    74  			// Used for values of type TIMESTAMP
    75  			timestampValue: time.Time @protobuf(7,google.protobuf.Timestamp,name=timestamp_value)
    76  		} | {
    77  			// Used for values of type DURATION
    78  			durationValue: time.Duration @protobuf(8,google.protobuf.Duration,name=duration_value)
    79  		} | {
    80  			// Used for values of type STRING_MAP
    81  			stringMapValue: #StringMap @protobuf(9,StringMap,name=string_map_value)
    82  		} | {
    83  			testValue: test.#Test @protobuf(10,acme.test.Test,name=test_value)
    84  		} | {
    85  			testValue: test_test.#AnotherTest @protobuf(11,acme.test.test.AnotherTest,name=test_value)
    86  		}
    87  	}
    88  
    89  	// Defines a string map.
    90  	#StringMap: {
    91  		// Holds a set of name/value pairs.
    92  		entries?: {
    93  			[string]: string
    94  		} @protobuf(1,map[string]string)
    95  	}
    96  }
    97  
    98  // Defines a list of attributes in compressed format optimized for transport.
    99  // Within this message, strings are referenced using integer indices into
   100  // one of two string dictionaries. Positive integers index into the global
   101  // deployment-wide dictionary, whereas negative integers index into the message-level
   102  // dictionary instead. The message-level dictionary is carried by the
   103  // `words` field of this message, the deployment-wide dictionary is determined via
   104  // configuration.
   105  #CompressedAttributes: {
   106  	// The message-level dictionary.
   107  	words?: [...string] @protobuf(1,string)
   108  
   109  	// Holds attributes of type STRING, DNS_NAME, EMAIL_ADDRESS, URI
   110  	strings?: {
   111  		[string]: int32
   112  	} @protobuf(2,map[sint32]sint32)
   113  
   114  	// Holds attributes of type INT64
   115  	int64s?: {
   116  		[string]: int64
   117  	} @protobuf(3,map[sint32]int64)
   118  
   119  	// Holds attributes of type DOUBLE
   120  	doubles?: {
   121  		[string]: float64
   122  	} @protobuf(4,map[sint32]double)
   123  
   124  	// Holds attributes of type BOOL
   125  	bools?: {
   126  		[string]: bool
   127  	} @protobuf(5,map[sint32]bool)
   128  
   129  	// Holds attributes of type TIMESTAMP
   130  	time?: {
   131  		[string]: time_1.Time
   132  	} @protobuf(6,map[sint32]google.protobuf.Timestamp,"(gogoproto.nullable)=false","(gogoproto.stdtime)")
   133  
   134  	// Holds attributes of type DURATION
   135  	durations?: {
   136  		[string]: time_1.Duration
   137  	} @protobuf(7,map[sint32]google.protobuf.Duration,"(gogoproto.nullable)=false","(gogoproto.stdduration)")
   138  
   139  	// Holds attributes of type BYTES
   140  	bytes?: {
   141  		[string]: bytes_5
   142  	} @protobuf(8,map[sint32]bytes)
   143  
   144  	// Holds attributes of type STRING_MAP
   145  	stringMaps?: {
   146  		[string]: #StringMap
   147  	} @protobuf(9,map[sint32]StringMap,string_maps,"(gogoproto.nullable)=false")
   148  }
   149  
   150  // A map of string to string. The keys and values in this map are dictionary
   151  // indices (see the [Attributes][istio.mixer.v1.CompressedAttributes] message for an explanation)
   152  #StringMap: {
   153  	// Holds a set of name/value pairs.
   154  	entries?: {
   155  		[string]: int32
   156  	} @protobuf(1,map[sint32]sint32)
   157  }
   158  
   159  let bytes_5 = bytes