reproto 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- .git/COMMIT_EDITMSG +30 -1
- .git/index +0 -0
- .git/logs/HEAD +1 -0
- .git/logs/refs/heads/iyue +1 -0
- .git/logs/refs/remotes/gitlab/iyue +1 -0
- .git/logs/refs/remotes/origin/iyue +1 -0
- .git/objects/03/3fab23ccc74b707a31f6f37dc5df42c100aac0 +0 -0
- .git/objects/07/b71df33935c14ddf99e3480c04eca4685028bc +0 -0
- .git/objects/0b/e20ea749c6ae1075ae98f9426e00b0a4a235af +0 -0
- .git/objects/13/5f50fea51c72f977f48d06a7584aba0f61e260 +0 -0
- .git/objects/1b/97584ebada3e93d7a2cfa4a1aae0b79c414d20 +0 -0
- .git/objects/1b/f0c1ad9586578e8332d061f7648dcb041ec063 +0 -0
- .git/objects/1e/46816d16e7c9db7575f1964403c3daa105be5c +0 -0
- .git/objects/27/24208ca2442e8ab9b453d0eb230fa41243b270 +0 -0
- .git/objects/2d/2b812ca27c477f9e1b2c2706a5eb795ffcf8eb +0 -0
- .git/objects/3f/b8830f516342a0ae1cb7c34b65016827cb9570 +4 -0
- .git/objects/41/f40c22247de377be99e30784229f3f128508a2 +0 -0
- .git/objects/48/cb11e75518a53be14146018214110986fade67 +0 -0
- .git/objects/4f/c6dc41f9c0a1a8e0eedd3ba49c43d78d0dbaba +0 -0
- .git/objects/59/4c23f158ccbd0a4288f9ea046d06160195afbf +0 -0
- .git/objects/5b/d4d87753b79e9157817f0c2e6964a731052854 +0 -0
- .git/objects/65/0189fe083bd711e45d463b229a72be619abad2 +0 -0
- .git/objects/66/663db35bfec8ef5f1a5b1c840fde1bb62a0eb8 +0 -0
- .git/objects/8a/0ed0ed8886fbc823e8d2258fa6d18699e94e25 +0 -0
- .git/objects/8d/d857b3d0ab3f5cd2e9173d532ef86e30df8eda +0 -0
- .git/objects/9e/23448ac58f907d9d123c32bdccedbb3d6741b5 +0 -0
- .git/objects/a0/d192999af7e2cbfa6a9ccd04d720a04e5a06d5 +0 -0
- .git/objects/a9/cc7923c34a4c97c5711d6309672f41d46c612a +0 -0
- .git/objects/af/c9cc15629847447063e86a82b8b56abb4fc08f +0 -0
- .git/objects/b1/db1c131cf32916028342c0037ce8eb57a8eb26 +0 -0
- .git/objects/b2/8334b94392b8af397a05ed702690fa6c9ab1ca +0 -0
- .git/objects/b8/7c89dcfce9e244ff5ef6a4bd394de12e8c8092 +0 -0
- .git/objects/d9/3bd435c8c7ad4efb83dff04d5450fabb9e3faf +0 -0
- .git/objects/e3/27755808d88c7ae5c06c229cf18bd0519646df +0 -0
- .git/objects/e5/83e7c40be934d16a1fa2e973487b395d930f42 +0 -0
- .git/objects/ed/1ae867d5e63195845afc58d88c38ecbdea97df +0 -0
- .git/objects/ef/f44e5099da27f7fb1ef14bb34902ccf4250b89 +0 -0
- .git/objects/f5/1be495b96272fa2e47f30071aed35ac1f0dd2c +0 -0
- .git/objects/fd/0bc07dc3c95e6168ab6d367d9eca139ac1e539 +0 -0
- .git/refs/heads/iyue +1 -1
- .git/refs/remotes/gitlab/iyue +1 -1
- .git/refs/remotes/origin/iyue +1 -1
- .gitignore +2 -1
- core/info_decoder.py +507 -6
- core/reconstructor.py +135 -6
- generation/proto_generator.py +51 -11
- include/google/protobuf/any.proto +162 -0
- include/google/protobuf/api.proto +207 -0
- include/google/protobuf/compiler/plugin.proto +180 -0
- include/google/protobuf/cpp_features.proto +67 -0
- include/google/protobuf/descriptor.proto +1417 -0
- include/google/protobuf/duration.proto +115 -0
- include/google/protobuf/empty.proto +51 -0
- include/google/protobuf/field_mask.proto +245 -0
- include/google/protobuf/go_features.proto +80 -0
- include/google/protobuf/java_features.proto +130 -0
- include/google/protobuf/source_context.proto +48 -0
- include/google/protobuf/struct.proto +95 -0
- include/google/protobuf/timestamp.proto +144 -0
- include/google/protobuf/type.proto +193 -0
- include/google/protobuf/wrappers.proto +157 -0
- parsing/java_parser.py +295 -12
- pyproject.toml +1 -1
- {reproto-0.1.1.dist-info → reproto-0.1.2.dist-info}/METADATA +1 -1
- {reproto-0.1.1.dist-info → reproto-0.1.2.dist-info}/RECORD +69 -20
- utils/builtin_proto.py +262 -0
- utils/type_utils.py +39 -6
- {reproto-0.1.1.dist-info → reproto-0.1.2.dist-info}/WHEEL +0 -0
- {reproto-0.1.1.dist-info → reproto-0.1.2.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,95 @@
|
|
1
|
+
// Protocol Buffers - Google's data interchange format
|
2
|
+
// Copyright 2008 Google Inc. All rights reserved.
|
3
|
+
// https://developers.google.com/protocol-buffers/
|
4
|
+
//
|
5
|
+
// Redistribution and use in source and binary forms, with or without
|
6
|
+
// modification, are permitted provided that the following conditions are
|
7
|
+
// met:
|
8
|
+
//
|
9
|
+
// * Redistributions of source code must retain the above copyright
|
10
|
+
// notice, this list of conditions and the following disclaimer.
|
11
|
+
// * Redistributions in binary form must reproduce the above
|
12
|
+
// copyright notice, this list of conditions and the following disclaimer
|
13
|
+
// in the documentation and/or other materials provided with the
|
14
|
+
// distribution.
|
15
|
+
// * Neither the name of Google Inc. nor the names of its
|
16
|
+
// contributors may be used to endorse or promote products derived from
|
17
|
+
// this software without specific prior written permission.
|
18
|
+
//
|
19
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
25
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
26
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
27
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
|
31
|
+
syntax = "proto3";
|
32
|
+
|
33
|
+
package google.protobuf;
|
34
|
+
|
35
|
+
option cc_enable_arenas = true;
|
36
|
+
option go_package = "google.golang.org/protobuf/types/known/structpb";
|
37
|
+
option java_package = "com.google.protobuf";
|
38
|
+
option java_outer_classname = "StructProto";
|
39
|
+
option java_multiple_files = true;
|
40
|
+
option objc_class_prefix = "GPB";
|
41
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
42
|
+
|
43
|
+
// `Struct` represents a structured data value, consisting of fields
|
44
|
+
// which map to dynamically typed values. In some languages, `Struct`
|
45
|
+
// might be supported by a native representation. For example, in
|
46
|
+
// scripting languages like JS a struct is represented as an
|
47
|
+
// object. The details of that representation are described together
|
48
|
+
// with the proto support for the language.
|
49
|
+
//
|
50
|
+
// The JSON representation for `Struct` is JSON object.
|
51
|
+
message Struct {
|
52
|
+
// Unordered map of dynamically typed values.
|
53
|
+
map<string, Value> fields = 1;
|
54
|
+
}
|
55
|
+
|
56
|
+
// `Value` represents a dynamically typed value which can be either
|
57
|
+
// null, a number, a string, a boolean, a recursive struct value, or a
|
58
|
+
// list of values. A producer of value is expected to set one of these
|
59
|
+
// variants. Absence of any variant indicates an error.
|
60
|
+
//
|
61
|
+
// The JSON representation for `Value` is JSON value.
|
62
|
+
message Value {
|
63
|
+
// The kind of value.
|
64
|
+
oneof kind {
|
65
|
+
// Represents a null value.
|
66
|
+
NullValue null_value = 1;
|
67
|
+
// Represents a double value.
|
68
|
+
double number_value = 2;
|
69
|
+
// Represents a string value.
|
70
|
+
string string_value = 3;
|
71
|
+
// Represents a boolean value.
|
72
|
+
bool bool_value = 4;
|
73
|
+
// Represents a structured value.
|
74
|
+
Struct struct_value = 5;
|
75
|
+
// Represents a repeated `Value`.
|
76
|
+
ListValue list_value = 6;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
// `NullValue` is a singleton enumeration to represent the null value for the
|
81
|
+
// `Value` type union.
|
82
|
+
//
|
83
|
+
// The JSON representation for `NullValue` is JSON `null`.
|
84
|
+
enum NullValue {
|
85
|
+
// Null value.
|
86
|
+
NULL_VALUE = 0;
|
87
|
+
}
|
88
|
+
|
89
|
+
// `ListValue` is a wrapper around a repeated field of values.
|
90
|
+
//
|
91
|
+
// The JSON representation for `ListValue` is JSON array.
|
92
|
+
message ListValue {
|
93
|
+
// Repeated field of dynamically typed values.
|
94
|
+
repeated Value values = 1;
|
95
|
+
}
|
@@ -0,0 +1,144 @@
|
|
1
|
+
// Protocol Buffers - Google's data interchange format
|
2
|
+
// Copyright 2008 Google Inc. All rights reserved.
|
3
|
+
// https://developers.google.com/protocol-buffers/
|
4
|
+
//
|
5
|
+
// Redistribution and use in source and binary forms, with or without
|
6
|
+
// modification, are permitted provided that the following conditions are
|
7
|
+
// met:
|
8
|
+
//
|
9
|
+
// * Redistributions of source code must retain the above copyright
|
10
|
+
// notice, this list of conditions and the following disclaimer.
|
11
|
+
// * Redistributions in binary form must reproduce the above
|
12
|
+
// copyright notice, this list of conditions and the following disclaimer
|
13
|
+
// in the documentation and/or other materials provided with the
|
14
|
+
// distribution.
|
15
|
+
// * Neither the name of Google Inc. nor the names of its
|
16
|
+
// contributors may be used to endorse or promote products derived from
|
17
|
+
// this software without specific prior written permission.
|
18
|
+
//
|
19
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
25
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
26
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
27
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
|
31
|
+
syntax = "proto3";
|
32
|
+
|
33
|
+
package google.protobuf;
|
34
|
+
|
35
|
+
option cc_enable_arenas = true;
|
36
|
+
option go_package = "google.golang.org/protobuf/types/known/timestamppb";
|
37
|
+
option java_package = "com.google.protobuf";
|
38
|
+
option java_outer_classname = "TimestampProto";
|
39
|
+
option java_multiple_files = true;
|
40
|
+
option objc_class_prefix = "GPB";
|
41
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
42
|
+
|
43
|
+
// A Timestamp represents a point in time independent of any time zone or local
|
44
|
+
// calendar, encoded as a count of seconds and fractions of seconds at
|
45
|
+
// nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
46
|
+
// January 1, 1970, in the proleptic Gregorian calendar which extends the
|
47
|
+
// Gregorian calendar backwards to year one.
|
48
|
+
//
|
49
|
+
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
50
|
+
// second table is needed for interpretation, using a [24-hour linear
|
51
|
+
// smear](https://developers.google.com/time/smear).
|
52
|
+
//
|
53
|
+
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
54
|
+
// restricting to that range, we ensure that we can convert to and from [RFC
|
55
|
+
// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
56
|
+
//
|
57
|
+
// # Examples
|
58
|
+
//
|
59
|
+
// Example 1: Compute Timestamp from POSIX `time()`.
|
60
|
+
//
|
61
|
+
// Timestamp timestamp;
|
62
|
+
// timestamp.set_seconds(time(NULL));
|
63
|
+
// timestamp.set_nanos(0);
|
64
|
+
//
|
65
|
+
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
66
|
+
//
|
67
|
+
// struct timeval tv;
|
68
|
+
// gettimeofday(&tv, NULL);
|
69
|
+
//
|
70
|
+
// Timestamp timestamp;
|
71
|
+
// timestamp.set_seconds(tv.tv_sec);
|
72
|
+
// timestamp.set_nanos(tv.tv_usec * 1000);
|
73
|
+
//
|
74
|
+
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
75
|
+
//
|
76
|
+
// FILETIME ft;
|
77
|
+
// GetSystemTimeAsFileTime(&ft);
|
78
|
+
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
79
|
+
//
|
80
|
+
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
81
|
+
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
82
|
+
// Timestamp timestamp;
|
83
|
+
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
84
|
+
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
85
|
+
//
|
86
|
+
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
87
|
+
//
|
88
|
+
// long millis = System.currentTimeMillis();
|
89
|
+
//
|
90
|
+
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
91
|
+
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
92
|
+
//
|
93
|
+
// Example 5: Compute Timestamp from Java `Instant.now()`.
|
94
|
+
//
|
95
|
+
// Instant now = Instant.now();
|
96
|
+
//
|
97
|
+
// Timestamp timestamp =
|
98
|
+
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
99
|
+
// .setNanos(now.getNano()).build();
|
100
|
+
//
|
101
|
+
// Example 6: Compute Timestamp from current time in Python.
|
102
|
+
//
|
103
|
+
// timestamp = Timestamp()
|
104
|
+
// timestamp.GetCurrentTime()
|
105
|
+
//
|
106
|
+
// # JSON Mapping
|
107
|
+
//
|
108
|
+
// In JSON format, the Timestamp type is encoded as a string in the
|
109
|
+
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
110
|
+
// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
111
|
+
// where {year} is always expressed using four digits while {month}, {day},
|
112
|
+
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
113
|
+
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
114
|
+
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
115
|
+
// is required. A proto3 JSON serializer should always use UTC (as indicated by
|
116
|
+
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
117
|
+
// able to accept both UTC and other timezones (as indicated by an offset).
|
118
|
+
//
|
119
|
+
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
120
|
+
// 01:30 UTC on January 15, 2017.
|
121
|
+
//
|
122
|
+
// In JavaScript, one can convert a Date object to this format using the
|
123
|
+
// standard
|
124
|
+
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
125
|
+
// method. In Python, a standard `datetime.datetime` object can be converted
|
126
|
+
// to this format using
|
127
|
+
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
128
|
+
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
129
|
+
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
130
|
+
// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
131
|
+
// ) to obtain a formatter capable of generating timestamps in this format.
|
132
|
+
//
|
133
|
+
message Timestamp {
|
134
|
+
// Represents seconds of UTC time since Unix epoch
|
135
|
+
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
136
|
+
// 9999-12-31T23:59:59Z inclusive.
|
137
|
+
int64 seconds = 1;
|
138
|
+
|
139
|
+
// Non-negative fractions of a second at nanosecond resolution. Negative
|
140
|
+
// second values with fractions must still have non-negative nanos values
|
141
|
+
// that count forward in time. Must be from 0 to 999,999,999
|
142
|
+
// inclusive.
|
143
|
+
int32 nanos = 2;
|
144
|
+
}
|
@@ -0,0 +1,193 @@
|
|
1
|
+
// Protocol Buffers - Google's data interchange format
|
2
|
+
// Copyright 2008 Google Inc. All rights reserved.
|
3
|
+
// https://developers.google.com/protocol-buffers/
|
4
|
+
//
|
5
|
+
// Redistribution and use in source and binary forms, with or without
|
6
|
+
// modification, are permitted provided that the following conditions are
|
7
|
+
// met:
|
8
|
+
//
|
9
|
+
// * Redistributions of source code must retain the above copyright
|
10
|
+
// notice, this list of conditions and the following disclaimer.
|
11
|
+
// * Redistributions in binary form must reproduce the above
|
12
|
+
// copyright notice, this list of conditions and the following disclaimer
|
13
|
+
// in the documentation and/or other materials provided with the
|
14
|
+
// distribution.
|
15
|
+
// * Neither the name of Google Inc. nor the names of its
|
16
|
+
// contributors may be used to endorse or promote products derived from
|
17
|
+
// this software without specific prior written permission.
|
18
|
+
//
|
19
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
25
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
26
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
27
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
|
31
|
+
syntax = "proto3";
|
32
|
+
|
33
|
+
package google.protobuf;
|
34
|
+
|
35
|
+
import "google/protobuf/any.proto";
|
36
|
+
import "google/protobuf/source_context.proto";
|
37
|
+
|
38
|
+
option cc_enable_arenas = true;
|
39
|
+
option java_package = "com.google.protobuf";
|
40
|
+
option java_outer_classname = "TypeProto";
|
41
|
+
option java_multiple_files = true;
|
42
|
+
option objc_class_prefix = "GPB";
|
43
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
44
|
+
option go_package = "google.golang.org/protobuf/types/known/typepb";
|
45
|
+
|
46
|
+
// A protocol buffer message type.
|
47
|
+
message Type {
|
48
|
+
// The fully qualified message name.
|
49
|
+
string name = 1;
|
50
|
+
// The list of fields.
|
51
|
+
repeated Field fields = 2;
|
52
|
+
// The list of types appearing in `oneof` definitions in this type.
|
53
|
+
repeated string oneofs = 3;
|
54
|
+
// The protocol buffer options.
|
55
|
+
repeated Option options = 4;
|
56
|
+
// The source context.
|
57
|
+
SourceContext source_context = 5;
|
58
|
+
// The source syntax.
|
59
|
+
Syntax syntax = 6;
|
60
|
+
// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
|
61
|
+
string edition = 7;
|
62
|
+
}
|
63
|
+
|
64
|
+
// A single field of a message type.
|
65
|
+
message Field {
|
66
|
+
// Basic field types.
|
67
|
+
enum Kind {
|
68
|
+
// Field type unknown.
|
69
|
+
TYPE_UNKNOWN = 0;
|
70
|
+
// Field type double.
|
71
|
+
TYPE_DOUBLE = 1;
|
72
|
+
// Field type float.
|
73
|
+
TYPE_FLOAT = 2;
|
74
|
+
// Field type int64.
|
75
|
+
TYPE_INT64 = 3;
|
76
|
+
// Field type uint64.
|
77
|
+
TYPE_UINT64 = 4;
|
78
|
+
// Field type int32.
|
79
|
+
TYPE_INT32 = 5;
|
80
|
+
// Field type fixed64.
|
81
|
+
TYPE_FIXED64 = 6;
|
82
|
+
// Field type fixed32.
|
83
|
+
TYPE_FIXED32 = 7;
|
84
|
+
// Field type bool.
|
85
|
+
TYPE_BOOL = 8;
|
86
|
+
// Field type string.
|
87
|
+
TYPE_STRING = 9;
|
88
|
+
// Field type group. Proto2 syntax only, and deprecated.
|
89
|
+
TYPE_GROUP = 10;
|
90
|
+
// Field type message.
|
91
|
+
TYPE_MESSAGE = 11;
|
92
|
+
// Field type bytes.
|
93
|
+
TYPE_BYTES = 12;
|
94
|
+
// Field type uint32.
|
95
|
+
TYPE_UINT32 = 13;
|
96
|
+
// Field type enum.
|
97
|
+
TYPE_ENUM = 14;
|
98
|
+
// Field type sfixed32.
|
99
|
+
TYPE_SFIXED32 = 15;
|
100
|
+
// Field type sfixed64.
|
101
|
+
TYPE_SFIXED64 = 16;
|
102
|
+
// Field type sint32.
|
103
|
+
TYPE_SINT32 = 17;
|
104
|
+
// Field type sint64.
|
105
|
+
TYPE_SINT64 = 18;
|
106
|
+
}
|
107
|
+
|
108
|
+
// Whether a field is optional, required, or repeated.
|
109
|
+
enum Cardinality {
|
110
|
+
// For fields with unknown cardinality.
|
111
|
+
CARDINALITY_UNKNOWN = 0;
|
112
|
+
// For optional fields.
|
113
|
+
CARDINALITY_OPTIONAL = 1;
|
114
|
+
// For required fields. Proto2 syntax only.
|
115
|
+
CARDINALITY_REQUIRED = 2;
|
116
|
+
// For repeated fields.
|
117
|
+
CARDINALITY_REPEATED = 3;
|
118
|
+
}
|
119
|
+
|
120
|
+
// The field type.
|
121
|
+
Kind kind = 1;
|
122
|
+
// The field cardinality.
|
123
|
+
Cardinality cardinality = 2;
|
124
|
+
// The field number.
|
125
|
+
int32 number = 3;
|
126
|
+
// The field name.
|
127
|
+
string name = 4;
|
128
|
+
// The field type URL, without the scheme, for message or enumeration
|
129
|
+
// types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
|
130
|
+
string type_url = 6;
|
131
|
+
// The index of the field type in `Type.oneofs`, for message or enumeration
|
132
|
+
// types. The first type has index 1; zero means the type is not in the list.
|
133
|
+
int32 oneof_index = 7;
|
134
|
+
// Whether to use alternative packed wire representation.
|
135
|
+
bool packed = 8;
|
136
|
+
// The protocol buffer options.
|
137
|
+
repeated Option options = 9;
|
138
|
+
// The field JSON name.
|
139
|
+
string json_name = 10;
|
140
|
+
// The string value of the default value of this field. Proto2 syntax only.
|
141
|
+
string default_value = 11;
|
142
|
+
}
|
143
|
+
|
144
|
+
// Enum type definition.
|
145
|
+
message Enum {
|
146
|
+
// Enum type name.
|
147
|
+
string name = 1;
|
148
|
+
// Enum value definitions.
|
149
|
+
repeated EnumValue enumvalue = 2;
|
150
|
+
// Protocol buffer options.
|
151
|
+
repeated Option options = 3;
|
152
|
+
// The source context.
|
153
|
+
SourceContext source_context = 4;
|
154
|
+
// The source syntax.
|
155
|
+
Syntax syntax = 5;
|
156
|
+
// The source edition string, only valid when syntax is SYNTAX_EDITIONS.
|
157
|
+
string edition = 6;
|
158
|
+
}
|
159
|
+
|
160
|
+
// Enum value definition.
|
161
|
+
message EnumValue {
|
162
|
+
// Enum value name.
|
163
|
+
string name = 1;
|
164
|
+
// Enum value number.
|
165
|
+
int32 number = 2;
|
166
|
+
// Protocol buffer options.
|
167
|
+
repeated Option options = 3;
|
168
|
+
}
|
169
|
+
|
170
|
+
// A protocol buffer option, which can be attached to a message, field,
|
171
|
+
// enumeration, etc.
|
172
|
+
message Option {
|
173
|
+
// The option's name. For protobuf built-in options (options defined in
|
174
|
+
// descriptor.proto), this is the short name. For example, `"map_entry"`.
|
175
|
+
// For custom options, it should be the fully-qualified name. For example,
|
176
|
+
// `"google.api.http"`.
|
177
|
+
string name = 1;
|
178
|
+
// The option's value packed in an Any message. If the value is a primitive,
|
179
|
+
// the corresponding wrapper type defined in google/protobuf/wrappers.proto
|
180
|
+
// should be used. If the value is an enum, it should be stored as an int32
|
181
|
+
// value using the google.protobuf.Int32Value type.
|
182
|
+
Any value = 2;
|
183
|
+
}
|
184
|
+
|
185
|
+
// The syntax in which a protocol buffer element is defined.
|
186
|
+
enum Syntax {
|
187
|
+
// Syntax `proto2`.
|
188
|
+
SYNTAX_PROTO2 = 0;
|
189
|
+
// Syntax `proto3`.
|
190
|
+
SYNTAX_PROTO3 = 1;
|
191
|
+
// Syntax `editions`.
|
192
|
+
SYNTAX_EDITIONS = 2;
|
193
|
+
}
|
@@ -0,0 +1,157 @@
|
|
1
|
+
// Protocol Buffers - Google's data interchange format
|
2
|
+
// Copyright 2008 Google Inc. All rights reserved.
|
3
|
+
// https://developers.google.com/protocol-buffers/
|
4
|
+
//
|
5
|
+
// Redistribution and use in source and binary forms, with or without
|
6
|
+
// modification, are permitted provided that the following conditions are
|
7
|
+
// met:
|
8
|
+
//
|
9
|
+
// * Redistributions of source code must retain the above copyright
|
10
|
+
// notice, this list of conditions and the following disclaimer.
|
11
|
+
// * Redistributions in binary form must reproduce the above
|
12
|
+
// copyright notice, this list of conditions and the following disclaimer
|
13
|
+
// in the documentation and/or other materials provided with the
|
14
|
+
// distribution.
|
15
|
+
// * Neither the name of Google Inc. nor the names of its
|
16
|
+
// contributors may be used to endorse or promote products derived from
|
17
|
+
// this software without specific prior written permission.
|
18
|
+
//
|
19
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
25
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
26
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
27
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
30
|
+
//
|
31
|
+
// Wrappers for primitive (non-message) types. These types were needed
|
32
|
+
// for legacy reasons and are not recommended for use in new APIs.
|
33
|
+
//
|
34
|
+
// Historically these wrappers were useful to have presence on proto3 primitive
|
35
|
+
// fields, but proto3 syntax has been updated to support the `optional` keyword.
|
36
|
+
// Using that keyword is now the strongly preferred way to add presence to
|
37
|
+
// proto3 primitive fields.
|
38
|
+
//
|
39
|
+
// A secondary usecase was to embed primitives in the `google.protobuf.Any`
|
40
|
+
// type: it is now recommended that you embed your value in your own wrapper
|
41
|
+
// message which can be specifically documented.
|
42
|
+
//
|
43
|
+
// These wrappers have no meaningful use within repeated fields as they lack
|
44
|
+
// the ability to detect presence on individual elements.
|
45
|
+
// These wrappers have no meaningful use within a map or a oneof since
|
46
|
+
// individual entries of a map or fields of a oneof can already detect presence.
|
47
|
+
|
48
|
+
syntax = "proto3";
|
49
|
+
|
50
|
+
package google.protobuf;
|
51
|
+
|
52
|
+
option cc_enable_arenas = true;
|
53
|
+
option go_package = "google.golang.org/protobuf/types/known/wrapperspb";
|
54
|
+
option java_package = "com.google.protobuf";
|
55
|
+
option java_outer_classname = "WrappersProto";
|
56
|
+
option java_multiple_files = true;
|
57
|
+
option objc_class_prefix = "GPB";
|
58
|
+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
59
|
+
|
60
|
+
// Wrapper message for `double`.
|
61
|
+
//
|
62
|
+
// The JSON representation for `DoubleValue` is JSON number.
|
63
|
+
//
|
64
|
+
// Not recommended for use in new APIs, but still useful for legacy APIs and
|
65
|
+
// has no plan to be removed.
|
66
|
+
message DoubleValue {
|
67
|
+
// The double value.
|
68
|
+
double value = 1;
|
69
|
+
}
|
70
|
+
|
71
|
+
// Wrapper message for `float`.
|
72
|
+
//
|
73
|
+
// The JSON representation for `FloatValue` is JSON number.
|
74
|
+
//
|
75
|
+
// Not recommended for use in new APIs, but still useful for legacy APIs and
|
76
|
+
// has no plan to be removed.
|
77
|
+
message FloatValue {
|
78
|
+
// The float value.
|
79
|
+
float value = 1;
|
80
|
+
}
|
81
|
+
|
82
|
+
// Wrapper message for `int64`.
|
83
|
+
//
|
84
|
+
// The JSON representation for `Int64Value` is JSON string.
|
85
|
+
//
|
86
|
+
// Not recommended for use in new APIs, but still useful for legacy APIs and
|
87
|
+
// has no plan to be removed.
|
88
|
+
message Int64Value {
|
89
|
+
// The int64 value.
|
90
|
+
int64 value = 1;
|
91
|
+
}
|
92
|
+
|
93
|
+
// Wrapper message for `uint64`.
|
94
|
+
//
|
95
|
+
// The JSON representation for `UInt64Value` is JSON string.
|
96
|
+
//
|
97
|
+
// Not recommended for use in new APIs, but still useful for legacy APIs and
|
98
|
+
// has no plan to be removed.
|
99
|
+
message UInt64Value {
|
100
|
+
// The uint64 value.
|
101
|
+
uint64 value = 1;
|
102
|
+
}
|
103
|
+
|
104
|
+
// Wrapper message for `int32`.
|
105
|
+
//
|
106
|
+
// The JSON representation for `Int32Value` is JSON number.
|
107
|
+
//
|
108
|
+
// Not recommended for use in new APIs, but still useful for legacy APIs and
|
109
|
+
// has no plan to be removed.
|
110
|
+
message Int32Value {
|
111
|
+
// The int32 value.
|
112
|
+
int32 value = 1;
|
113
|
+
}
|
114
|
+
|
115
|
+
// Wrapper message for `uint32`.
|
116
|
+
//
|
117
|
+
// The JSON representation for `UInt32Value` is JSON number.
|
118
|
+
//
|
119
|
+
// Not recommended for use in new APIs, but still useful for legacy APIs and
|
120
|
+
// has no plan to be removed.
|
121
|
+
message UInt32Value {
|
122
|
+
// The uint32 value.
|
123
|
+
uint32 value = 1;
|
124
|
+
}
|
125
|
+
|
126
|
+
// Wrapper message for `bool`.
|
127
|
+
//
|
128
|
+
// The JSON representation for `BoolValue` is JSON `true` and `false`.
|
129
|
+
//
|
130
|
+
// Not recommended for use in new APIs, but still useful for legacy APIs and
|
131
|
+
// has no plan to be removed.
|
132
|
+
message BoolValue {
|
133
|
+
// The bool value.
|
134
|
+
bool value = 1;
|
135
|
+
}
|
136
|
+
|
137
|
+
// Wrapper message for `string`.
|
138
|
+
//
|
139
|
+
// The JSON representation for `StringValue` is JSON string.
|
140
|
+
//
|
141
|
+
// Not recommended for use in new APIs, but still useful for legacy APIs and
|
142
|
+
// has no plan to be removed.
|
143
|
+
message StringValue {
|
144
|
+
// The string value.
|
145
|
+
string value = 1;
|
146
|
+
}
|
147
|
+
|
148
|
+
// Wrapper message for `bytes`.
|
149
|
+
//
|
150
|
+
// The JSON representation for `BytesValue` is JSON string.
|
151
|
+
//
|
152
|
+
// Not recommended for use in new APIs, but still useful for legacy APIs and
|
153
|
+
// has no plan to be removed.
|
154
|
+
message BytesValue {
|
155
|
+
// The bytes value.
|
156
|
+
bytes value = 1;
|
157
|
+
}
|