etcdv3 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,125 @@
1
+ // Protocol Buffers for Go with Gadgets
2
+ //
3
+ // Copyright (c) 2013, The GoGo Authors. All rights reserved.
4
+ // http://github.com/gogo/protobuf
5
+ //
6
+ // Redistribution and use in source and binary forms, with or without
7
+ // modification, are permitted provided that the following conditions are
8
+ // met:
9
+ //
10
+ // * Redistributions of source code must retain the above copyright
11
+ // notice, this list of conditions and the following disclaimer.
12
+ // * Redistributions in binary form must reproduce the above
13
+ // copyright notice, this list of conditions and the following disclaimer
14
+ // in the documentation and/or other materials provided with the
15
+ // distribution.
16
+ //
17
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+
29
+ syntax = "proto2";
30
+ package gogoproto;
31
+
32
+ import "descriptor.proto";
33
+
34
+ option java_package = "com.google.protobuf";
35
+ option java_outer_classname = "GoGoProtos";
36
+
37
+ extend google.protobuf.EnumOptions {
38
+ optional bool goproto_enum_prefix = 62001;
39
+ optional bool goproto_enum_stringer = 62021;
40
+ optional bool enum_stringer = 62022;
41
+ optional string enum_customname = 62023;
42
+ }
43
+
44
+ extend google.protobuf.EnumValueOptions {
45
+ optional string enumvalue_customname = 66001;
46
+ }
47
+
48
+ extend google.protobuf.FileOptions {
49
+ optional bool goproto_getters_all = 63001;
50
+ optional bool goproto_enum_prefix_all = 63002;
51
+ optional bool goproto_stringer_all = 63003;
52
+ optional bool verbose_equal_all = 63004;
53
+ optional bool face_all = 63005;
54
+ optional bool gostring_all = 63006;
55
+ optional bool populate_all = 63007;
56
+ optional bool stringer_all = 63008;
57
+ optional bool onlyone_all = 63009;
58
+
59
+ optional bool equal_all = 63013;
60
+ optional bool description_all = 63014;
61
+ optional bool testgen_all = 63015;
62
+ optional bool benchgen_all = 63016;
63
+ optional bool marshaler_all = 63017;
64
+ optional bool unmarshaler_all = 63018;
65
+ optional bool stable_marshaler_all = 63019;
66
+
67
+ optional bool sizer_all = 63020;
68
+
69
+ optional bool goproto_enum_stringer_all = 63021;
70
+ optional bool enum_stringer_all = 63022;
71
+
72
+ optional bool unsafe_marshaler_all = 63023;
73
+ optional bool unsafe_unmarshaler_all = 63024;
74
+
75
+ optional bool goproto_extensions_map_all = 63025;
76
+ optional bool goproto_unrecognized_all = 63026;
77
+ optional bool gogoproto_import = 63027;
78
+ optional bool protosizer_all = 63028;
79
+ optional bool compare_all = 63029;
80
+ }
81
+
82
+ extend google.protobuf.MessageOptions {
83
+ optional bool goproto_getters = 64001;
84
+ optional bool goproto_stringer = 64003;
85
+ optional bool verbose_equal = 64004;
86
+ optional bool face = 64005;
87
+ optional bool gostring = 64006;
88
+ optional bool populate = 64007;
89
+ optional bool stringer = 67008;
90
+ optional bool onlyone = 64009;
91
+
92
+ optional bool equal = 64013;
93
+ optional bool description = 64014;
94
+ optional bool testgen = 64015;
95
+ optional bool benchgen = 64016;
96
+ optional bool marshaler = 64017;
97
+ optional bool unmarshaler = 64018;
98
+ optional bool stable_marshaler = 64019;
99
+
100
+ optional bool sizer = 64020;
101
+
102
+ optional bool unsafe_marshaler = 64023;
103
+ optional bool unsafe_unmarshaler = 64024;
104
+
105
+ optional bool goproto_extensions_map = 64025;
106
+ optional bool goproto_unrecognized = 64026;
107
+
108
+ optional bool protosizer = 64028;
109
+ optional bool compare = 64029;
110
+ }
111
+
112
+ extend google.protobuf.FieldOptions {
113
+ optional bool nullable = 65001;
114
+ optional bool embed = 65002;
115
+ optional string customtype = 65003;
116
+ optional string customname = 65004;
117
+ optional string jsontag = 65005;
118
+ optional string moretags = 65006;
119
+ optional string casttype = 65007;
120
+ optional string castkey = 65008;
121
+ optional string castvalue = 65009;
122
+
123
+ optional bool stdtime = 65010;
124
+ optional bool stdduration = 65011;
125
+ }
@@ -0,0 +1,285 @@
1
+ // Copyright 2016 Google Inc.
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 google.api;
18
+
19
+ option cc_enable_arenas = true;
20
+ option java_multiple_files = true;
21
+ option java_outer_classname = "HttpProto";
22
+ option java_package = "com.google.api";
23
+ option objc_class_prefix = "GAPI";
24
+
25
+
26
+ // Defines the HTTP configuration for a service. It contains a list of
27
+ // [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
28
+ // to one or more HTTP REST API methods.
29
+ message Http {
30
+ // A list of HTTP configuration rules that apply to individual API methods.
31
+ //
32
+ // **NOTE:** All service configuration rules follow "last one wins" order.
33
+ repeated HttpRule rules = 1;
34
+ }
35
+
36
+ // `HttpRule` defines the mapping of an RPC method to one or more HTTP
37
+ // REST APIs. The mapping determines what portions of the request
38
+ // message are populated from the path, query parameters, or body of
39
+ // the HTTP request. The mapping is typically specified as an
40
+ // `google.api.http` annotation, see "google/api/annotations.proto"
41
+ // for details.
42
+ //
43
+ // The mapping consists of a field specifying the path template and
44
+ // method kind. The path template can refer to fields in the request
45
+ // message, as in the example below which describes a REST GET
46
+ // operation on a resource collection of messages:
47
+ //
48
+ // ```proto
49
+ // service Messaging {
50
+ // rpc GetMessage(GetMessageRequest) returns (Message) {
51
+ // option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}";
52
+ // }
53
+ // }
54
+ // message GetMessageRequest {
55
+ // message SubMessage {
56
+ // string subfield = 1;
57
+ // }
58
+ // string message_id = 1; // mapped to the URL
59
+ // SubMessage sub = 2; // `sub.subfield` is url-mapped
60
+ // }
61
+ // message Message {
62
+ // string text = 1; // content of the resource
63
+ // }
64
+ // ```
65
+ //
66
+ // This definition enables an automatic, bidrectional mapping of HTTP
67
+ // JSON to RPC. Example:
68
+ //
69
+ // HTTP | RPC
70
+ // -----|-----
71
+ // `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))`
72
+ //
73
+ // In general, not only fields but also field paths can be referenced
74
+ // from a path pattern. Fields mapped to the path pattern cannot be
75
+ // repeated and must have a primitive (non-message) type.
76
+ //
77
+ // Any fields in the request message which are not bound by the path
78
+ // pattern automatically become (optional) HTTP query
79
+ // parameters. Assume the following definition of the request message:
80
+ //
81
+ // ```proto
82
+ // message GetMessageRequest {
83
+ // message SubMessage {
84
+ // string subfield = 1;
85
+ // }
86
+ // string message_id = 1; // mapped to the URL
87
+ // int64 revision = 2; // becomes a parameter
88
+ // SubMessage sub = 3; // `sub.subfield` becomes a parameter
89
+ // }
90
+ // ```
91
+ //
92
+ // This enables a HTTP JSON to RPC mapping as below:
93
+ //
94
+ // HTTP | RPC
95
+ // -----|-----
96
+ // `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))`
97
+ //
98
+ // Note that fields which are mapped to HTTP parameters must have a
99
+ // primitive type or a repeated primitive type. Message types are not
100
+ // allowed. In the case of a repeated type, the parameter can be
101
+ // repeated in the URL, as in `...?param=A&param=B`.
102
+ //
103
+ // For HTTP method kinds which allow a request body, the `body` field
104
+ // specifies the mapping. Consider a REST update method on the
105
+ // message resource collection:
106
+ //
107
+ // ```proto
108
+ // service Messaging {
109
+ // rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
110
+ // option (google.api.http) = {
111
+ // put: "/v1/messages/{message_id}"
112
+ // body: "message"
113
+ // };
114
+ // }
115
+ // }
116
+ // message UpdateMessageRequest {
117
+ // string message_id = 1; // mapped to the URL
118
+ // Message message = 2; // mapped to the body
119
+ // }
120
+ // ```
121
+ //
122
+ // The following HTTP JSON to RPC mapping is enabled, where the
123
+ // representation of the JSON in the request body is determined by
124
+ // protos JSON encoding:
125
+ //
126
+ // HTTP | RPC
127
+ // -----|-----
128
+ // `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
129
+ //
130
+ // The special name `*` can be used in the body mapping to define that
131
+ // every field not bound by the path template should be mapped to the
132
+ // request body. This enables the following alternative definition of
133
+ // the update method:
134
+ //
135
+ // ```proto
136
+ // service Messaging {
137
+ // rpc UpdateMessage(Message) returns (Message) {
138
+ // option (google.api.http) = {
139
+ // put: "/v1/messages/{message_id}"
140
+ // body: "*"
141
+ // };
142
+ // }
143
+ // }
144
+ // message Message {
145
+ // string message_id = 1;
146
+ // string text = 2;
147
+ // }
148
+ // ```
149
+ //
150
+ // The following HTTP JSON to RPC mapping is enabled:
151
+ //
152
+ // HTTP | RPC
153
+ // -----|-----
154
+ // `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")`
155
+ //
156
+ // Note that when using `*` in the body mapping, it is not possible to
157
+ // have HTTP parameters, as all fields not bound by the path end in
158
+ // the body. This makes this option more rarely used in practice of
159
+ // defining REST APIs. The common usage of `*` is in custom methods
160
+ // which don't use the URL at all for transferring data.
161
+ //
162
+ // It is possible to define multiple HTTP methods for one RPC by using
163
+ // the `additional_bindings` option. Example:
164
+ //
165
+ // ```proto
166
+ // service Messaging {
167
+ // rpc GetMessage(GetMessageRequest) returns (Message) {
168
+ // option (google.api.http) = {
169
+ // get: "/v1/messages/{message_id}"
170
+ // additional_bindings {
171
+ // get: "/v1/users/{user_id}/messages/{message_id}"
172
+ // }
173
+ // };
174
+ // }
175
+ // }
176
+ // message GetMessageRequest {
177
+ // string message_id = 1;
178
+ // string user_id = 2;
179
+ // }
180
+ // ```
181
+ //
182
+ // This enables the following two alternative HTTP JSON to RPC
183
+ // mappings:
184
+ //
185
+ // HTTP | RPC
186
+ // -----|-----
187
+ // `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
188
+ // `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")`
189
+ //
190
+ // # Rules for HTTP mapping
191
+ //
192
+ // The rules for mapping HTTP path, query parameters, and body fields
193
+ // to the request message are as follows:
194
+ //
195
+ // 1. The `body` field specifies either `*` or a field path, or is
196
+ // omitted. If omitted, it assumes there is no HTTP body.
197
+ // 2. Leaf fields (recursive expansion of nested messages in the
198
+ // request) can be classified into three types:
199
+ // (a) Matched in the URL template.
200
+ // (b) Covered by body (if body is `*`, everything except (a) fields;
201
+ // else everything under the body field)
202
+ // (c) All other fields.
203
+ // 3. URL query parameters found in the HTTP request are mapped to (c) fields.
204
+ // 4. Any body sent with an HTTP request can contain only (b) fields.
205
+ //
206
+ // The syntax of the path template is as follows:
207
+ //
208
+ // Template = "/" Segments [ Verb ] ;
209
+ // Segments = Segment { "/" Segment } ;
210
+ // Segment = "*" | "**" | LITERAL | Variable ;
211
+ // Variable = "{" FieldPath [ "=" Segments ] "}" ;
212
+ // FieldPath = IDENT { "." IDENT } ;
213
+ // Verb = ":" LITERAL ;
214
+ //
215
+ // The syntax `*` matches a single path segment. It follows the semantics of
216
+ // [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
217
+ // Expansion.
218
+ //
219
+ // The syntax `**` matches zero or more path segments. It follows the semantics
220
+ // of [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.3 Reserved
221
+ // Expansion.
222
+ //
223
+ // The syntax `LITERAL` matches literal text in the URL path.
224
+ //
225
+ // The syntax `Variable` matches the entire path as specified by its template;
226
+ // this nested template must not contain further variables. If a variable
227
+ // matches a single path segment, its template may be omitted, e.g. `{var}`
228
+ // is equivalent to `{var=*}`.
229
+ //
230
+ // NOTE: the field paths in variables and in the `body` must not refer to
231
+ // repeated fields or map fields.
232
+ //
233
+ // Use CustomHttpPattern to specify any HTTP method that is not included in the
234
+ // `pattern` field, such as HEAD, or "*" to leave the HTTP method unspecified for
235
+ // a given URL path rule. The wild-card rule is useful for services that provide
236
+ // content to Web (HTML) clients.
237
+ message HttpRule {
238
+ // Selects methods to which this rule applies.
239
+ //
240
+ // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
241
+ string selector = 1;
242
+
243
+ // Determines the URL pattern is matched by this rules. This pattern can be
244
+ // used with any of the {get|put|post|delete|patch} methods. A custom method
245
+ // can be defined using the 'custom' field.
246
+ oneof pattern {
247
+ // Used for listing and getting information about resources.
248
+ string get = 2;
249
+
250
+ // Used for updating a resource.
251
+ string put = 3;
252
+
253
+ // Used for creating a resource.
254
+ string post = 4;
255
+
256
+ // Used for deleting a resource.
257
+ string delete = 5;
258
+
259
+ // Used for updating a resource.
260
+ string patch = 6;
261
+
262
+ // Custom pattern is used for defining custom verbs.
263
+ CustomHttpPattern custom = 8;
264
+ }
265
+
266
+ // The name of the request field whose value is mapped to the HTTP body, or
267
+ // `*` for mapping all fields not captured by the path pattern to the HTTP
268
+ // body. NOTE: the referred field must not be a repeated field and must be
269
+ // present at the top-level of response message type.
270
+ string body = 7;
271
+
272
+ // Additional HTTP bindings for the selector. Nested bindings must
273
+ // not contain an `additional_bindings` field themselves (that is,
274
+ // the nesting may only be one level deep).
275
+ repeated HttpRule additional_bindings = 11;
276
+ }
277
+
278
+ // A custom pattern is used for defining custom HTTP verb.
279
+ message CustomHttpPattern {
280
+ // The name of this custom HTTP verb.
281
+ string kind = 1;
282
+
283
+ // The path matched by this custom verb.
284
+ string path = 2;
285
+ }
@@ -0,0 +1,49 @@
1
+ syntax = "proto3";
2
+ package mvccpb;
3
+
4
+ import "gogo.proto";
5
+
6
+ option (gogoproto.marshaler_all) = true;
7
+ option (gogoproto.sizer_all) = true;
8
+ option (gogoproto.unmarshaler_all) = true;
9
+ option (gogoproto.goproto_getters_all) = false;
10
+ option (gogoproto.goproto_enum_prefix_all) = false;
11
+
12
+ message KeyValue {
13
+ // key is the key in bytes. An empty key is not allowed.
14
+ bytes key = 1;
15
+ // create_revision is the revision of last creation on this key.
16
+ int64 create_revision = 2;
17
+ // mod_revision is the revision of last modification on this key.
18
+ int64 mod_revision = 3;
19
+ // version is the version of the key. A deletion resets
20
+ // the version to zero and any modification of the key
21
+ // increases its version.
22
+ int64 version = 4;
23
+ // value is the value held by the key, in bytes.
24
+ bytes value = 5;
25
+ // lease is the ID of the lease that attached to key.
26
+ // When the attached lease expires, the key will be deleted.
27
+ // If lease is 0, then no lease is attached to the key.
28
+ int64 lease = 6;
29
+ }
30
+
31
+ message Event {
32
+ enum EventType {
33
+ PUT = 0;
34
+ DELETE = 1;
35
+ }
36
+ // type is the kind of event. If type is a PUT, it indicates
37
+ // new data has been stored to the key. If type is a DELETE,
38
+ // it indicates the key was deleted.
39
+ EventType type = 1;
40
+ // kv holds the KeyValue for the event.
41
+ // A PUT event contains current kv pair.
42
+ // A PUT event with kv.Version=1 indicates the creation of a key.
43
+ // A DELETE/EXPIRE event contains the deleted key with
44
+ // its modification revision set to the revision of deletion.
45
+ KeyValue kv = 2;
46
+
47
+ // prev_kv holds the key-value pair before the event happens.
48
+ KeyValue prev_kv = 3;
49
+ }