cuelang.org/go@v0.10.1/encoding/protobuf/testdata/istio.io/api/mixer/v1/attributes.proto (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 15 syntax = "proto3"; 16 17 package istio.mixer.v1; 18 19 option go_package = "istio.io/api/mixer/v1"; 20 21 import "gogoproto/gogo.proto"; 22 import "google/protobuf/duration.proto"; 23 import "google/protobuf/timestamp.proto"; 24 import "google/protobuf/struct.proto"; 25 import "acme/test.proto"; 26 import "acme/test/test.proto"; 27 28 option (gogoproto.goproto_getters_all) = false; 29 option (gogoproto.equal_all) = false; 30 option (gogoproto.gostring_all) = false; 31 option (gogoproto.stable_marshaler_all) = true; 32 option cc_enable_arenas = true; 33 34 message StructWrap { 35 google.protobuf.Struct struct = 1; 36 37 google.protobuf.Value any = 2; 38 google.protobuf.ListValue listVal = 3; 39 google.protobuf.BoolValue boolVal = 4; 40 google.protobuf.StringValue stringVal = 5; 41 google.protobuf.NumberValue numberVal = 6; 42 } 43 44 // Attributes represents a set of typed name/value pairs. Many of Mixer's 45 // API either consume and/or return attributes. 46 // 47 // Istio uses attributes to control the runtime behavior of services running in the service mesh. 48 // Attributes are named and typed pieces of metadata describing ingress and egress traffic and the 49 // environment this traffic occurs in. An Istio attribute carries a specific piece 50 // of information such as the error code of an API request, the latency of an API request, or the 51 // original IP address of a TCP connection. For example: 52 // 53 // ```yaml 54 // request.path: xyz/abc 55 // request.size: 234 56 // request.time: 12:34:56.789 04/17/2017 57 // source.ip: 192.168.0.1 58 // target.service: example 59 // ``` 60 // 61 message Attributes { 62 // A map of attribute name to its value. 63 map<string, AttributeValue> attributes = 1; 64 65 // Specifies one attribute value with different type. 66 message AttributeValue { 67 // The attribute value. 68 oneof value { 69 // Used for values of type STRING, DNS_NAME, EMAIL_ADDRESS, and URI 70 string string_value = 2; 71 72 // Used for values of type INT64 73 int64 int64_value = 3; 74 75 // Used for values of type DOUBLE 76 double double_value = 4; 77 78 // Used for values of type BOOL 79 bool bool_value = 5; 80 81 // Used for values of type BYTES 82 bytes bytes_value = 6; 83 84 // Used for values of type TIMESTAMP 85 google.protobuf.Timestamp timestamp_value = 7; 86 87 // Used for values of type DURATION 88 google.protobuf.Duration duration_value = 8; 89 90 // Used for values of type STRING_MAP 91 StringMap string_map_value = 9; 92 93 acme.test.Test test_value = 10; 94 acme.test.test.AnotherTest test_value = 11; 95 } 96 } 97 98 // Defines a string map. 99 message StringMap { 100 // Holds a set of name/value pairs. 101 map<string, string> entries = 1; 102 } 103 } 104 105 // Defines a list of attributes in compressed format optimized for transport. 106 // Within this message, strings are referenced using integer indices into 107 // one of two string dictionaries. Positive integers index into the global 108 // deployment-wide dictionary, whereas negative integers index into the message-level 109 // dictionary instead. The message-level dictionary is carried by the 110 // `words` field of this message, the deployment-wide dictionary is determined via 111 // configuration. 112 message CompressedAttributes { 113 // The message-level dictionary. 114 repeated string words = 1; 115 116 // Holds attributes of type STRING, DNS_NAME, EMAIL_ADDRESS, URI 117 map<sint32, sint32> strings = 2; 118 119 // Holds attributes of type INT64 120 map<sint32, int64> int64s = 3; 121 122 // Holds attributes of type DOUBLE 123 map<sint32, double> doubles = 4; 124 125 // Holds attributes of type BOOL 126 map<sint32, bool> bools = 5; 127 128 // Holds attributes of type TIMESTAMP 129 map<sint32, google.protobuf.Timestamp> time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; 130 131 // Holds attributes of type DURATION 132 map<sint32, google.protobuf.Duration> durations = 7 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; 133 134 // Holds attributes of type BYTES 135 map<sint32, bytes> bytes = 8; 136 137 // Holds attributes of type STRING_MAP 138 map<sint32, StringMap> string_maps = 9 [(gogoproto.nullable) = false]; 139 } 140 141 // A map of string to string. The keys and values in this map are dictionary 142 // indices (see the [Attributes][istio.mixer.v1.CompressedAttributes] message for an explanation) 143 message StringMap { 144 // Holds a set of name/value pairs. 145 map<sint32, sint32> entries = 1; 146 }