protobufjs 5.0.1 → 5.0.2
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.
- package/.travis.yml +2 -1
- package/README.md +144 -22
- package/bin/pbjs +2 -2
- package/bower.json +2 -2
- package/cli/pbjs/targets/amd.js +1 -1
- package/cli/pbjs/targets/json.js +8 -0
- package/cli/pbjs/util.js +1 -1
- package/cli/pbjs.js +1 -1
- package/dist/protobuf-light.js +166 -128
- package/dist/protobuf-light.min.js +88 -81
- package/dist/protobuf-light.min.js.gz +0 -0
- package/dist/protobuf-light.min.map +4 -4
- package/dist/protobuf.js +171 -129
- package/dist/protobuf.min.js +106 -98
- package/dist/protobuf.min.js.gz +0 -0
- package/dist/protobuf.min.map +4 -4
- package/docs/ProtoBuf.Builder.Message.html +1408 -971
- package/docs/ProtoBuf.Builder.Service.html +266 -197
- package/docs/ProtoBuf.Builder.html +758 -542
- package/docs/ProtoBuf.DotProto.Parser.html +223 -161
- package/docs/ProtoBuf.DotProto.Tokenizer.html +344 -248
- package/docs/ProtoBuf.DotProto.html +20 -12
- package/docs/ProtoBuf.Element.html +554 -554
- package/docs/ProtoBuf.Map.html +158 -123
- package/docs/ProtoBuf.Reflect.Element.html +286 -143
- package/docs/ProtoBuf.Reflect.Enum.Value.html +329 -228
- package/docs/ProtoBuf.Reflect.Enum.html +757 -537
- package/docs/ProtoBuf.Reflect.Extension.html +73 -56
- package/docs/ProtoBuf.Reflect.Message.ExtensionField.html +1013 -740
- package/docs/ProtoBuf.Reflect.Message.Field.html +926 -649
- package/docs/ProtoBuf.Reflect.Message.OneOf.html +327 -245
- package/docs/ProtoBuf.Reflect.Message.html +915 -651
- package/docs/ProtoBuf.Reflect.Namespace.html +648 -447
- package/docs/ProtoBuf.Reflect.Service.Method.html +363 -251
- package/docs/ProtoBuf.Reflect.Service.RPCMethod.html +545 -397
- package/docs/ProtoBuf.Reflect.Service.html +721 -511
- package/docs/ProtoBuf.Reflect.T.html +268 -197
- package/docs/ProtoBuf.Reflect.html +20 -12
- package/docs/ProtoBuf.Util.html +169 -118
- package/docs/ProtoBuf.html +840 -628
- package/docs/ProtoBuf.js.html +177 -134
- package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/index.html +7 -5
- package/docs/styles/jsdoc-default.css +95 -75
- package/docs/styles/prettify-tomorrow.css +1 -1
- package/examples/protoify/json.js +123 -123
- package/examples/protoify/json.json +123 -123
- package/examples/websocket/server.js +4 -4
- package/externs/protobuf.js +1 -1
- package/jsdoc.json +1 -1
- package/package.json +2 -2
- package/scripts/build.js +53 -53
- package/src/ProtoBuf/Builder/Message.js +9 -5
- package/src/ProtoBuf/Builder.js +19 -2
- package/src/ProtoBuf/DotProto/Parser.js +5 -1
- package/src/ProtoBuf/Reflect/Element.js +13 -1
- package/src/ProtoBuf/Reflect/Message/Field.js +2 -2
- package/src/ProtoBuf/Reflect/Message.js +6 -1
- package/src/ProtoBuf/Util.js +116 -116
- package/src/bower.json +1 -1
- package/src/google/protobuf/descriptor.json +27 -1
- package/tests/bench.txt +373 -373
- package/tests/complex.json +8 -1
- package/tests/custom-options.json +169 -169
- package/tests/extend.json +71 -71
- package/tests/imports.json +83 -83
- package/tests/nodeunit-browser/nodeunit.css +70 -70
- package/tests/nodeunit-browser/nodeunit.js +2108 -2108
- package/tests/options.json +32 -32
- package/tests/proto2js/Bar.json +46 -46
- package/tests/suite.js +43 -1
- package/sandbox/gapi/googleapis/google/api/annotations.proto +0 -29
- package/sandbox/gapi/googleapis/google/api/http.proto +0 -245
- package/sandbox/gapi/googleapis/google/datastore/v1beta3/datastore.proto +0 -281
- package/sandbox/gapi/googleapis/google/datastore/v1beta3/entity.proto +0 -189
- package/sandbox/gapi/googleapis/google/datastore/v1beta3/query.proto +0 -281
- package/sandbox/gapi/googleapis/google/longrunning/operations.proto +0 -144
- package/sandbox/gapi/googleapis/google/protobuf/any.proto +0 -98
- package/sandbox/gapi/googleapis/google/protobuf/any_test.proto +0 -41
- package/sandbox/gapi/googleapis/google/protobuf/api.proto +0 -201
- package/sandbox/gapi/googleapis/google/protobuf/descriptor.proto +0 -773
- package/sandbox/gapi/googleapis/google/protobuf/duration.proto +0 -95
- package/sandbox/gapi/googleapis/google/protobuf/empty.proto +0 -50
- package/sandbox/gapi/googleapis/google/protobuf/field_mask.proto +0 -167
- package/sandbox/gapi/googleapis/google/protobuf/map_lite_unittest.proto +0 -130
- package/sandbox/gapi/googleapis/google/protobuf/map_proto2_unittest.proto +0 -60
- package/sandbox/gapi/googleapis/google/protobuf/map_unittest.proto +0 -129
- package/sandbox/gapi/googleapis/google/protobuf/map_unittest_proto3.proto +0 -120
- package/sandbox/gapi/googleapis/google/protobuf/source_context.proto +0 -47
- package/sandbox/gapi/googleapis/google/protobuf/struct.proto +0 -94
- package/sandbox/gapi/googleapis/google/protobuf/timestamp.proto +0 -107
- package/sandbox/gapi/googleapis/google/protobuf/type.proto +0 -176
- package/sandbox/gapi/googleapis/google/protobuf/unittest.proto +0 -878
- package/sandbox/gapi/googleapis/google/protobuf/unittest_arena.proto +0 -46
- package/sandbox/gapi/googleapis/google/protobuf/unittest_custom_options.proto +0 -394
- package/sandbox/gapi/googleapis/google/protobuf/unittest_drop_unknown_fields.proto +0 -58
- package/sandbox/gapi/googleapis/google/protobuf/unittest_embed_optimize_for.proto +0 -51
- package/sandbox/gapi/googleapis/google/protobuf/unittest_empty.proto +0 -38
- package/sandbox/gapi/googleapis/google/protobuf/unittest_enormous_descriptor.proto +0 -1048
- package/sandbox/gapi/googleapis/google/protobuf/unittest_import.proto +0 -66
- package/sandbox/gapi/googleapis/google/protobuf/unittest_import_lite.proto +0 -52
- package/sandbox/gapi/googleapis/google/protobuf/unittest_import_proto3.proto +0 -68
- package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public.proto +0 -41
- package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public_lite.proto +0 -43
- package/sandbox/gapi/googleapis/google/protobuf/unittest_import_public_proto3.proto +0 -42
- package/sandbox/gapi/googleapis/google/protobuf/unittest_lite.proto +0 -385
- package/sandbox/gapi/googleapis/google/protobuf/unittest_lite_imports_nonlite.proto +0 -44
- package/sandbox/gapi/googleapis/google/protobuf/unittest_mset.proto +0 -82
- package/sandbox/gapi/googleapis/google/protobuf/unittest_mset_wire_format.proto +0 -52
- package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena.proto +0 -202
- package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena_import.proto +0 -37
- package/sandbox/gapi/googleapis/google/protobuf/unittest_no_arena_lite.proto +0 -42
- package/sandbox/gapi/googleapis/google/protobuf/unittest_no_field_presence.proto +0 -138
- package/sandbox/gapi/googleapis/google/protobuf/unittest_no_generic_services.proto +0 -54
- package/sandbox/gapi/googleapis/google/protobuf/unittest_optimize_for.proto +0 -67
- package/sandbox/gapi/googleapis/google/protobuf/unittest_preserve_unknown_enum.proto +0 -71
- package/sandbox/gapi/googleapis/google/protobuf/unittest_preserve_unknown_enum2.proto +0 -50
- package/sandbox/gapi/googleapis/google/protobuf/unittest_proto3.proto +0 -388
- package/sandbox/gapi/googleapis/google/protobuf/unittest_proto3_arena.proto +0 -206
- package/sandbox/gapi/googleapis/google/protobuf/unittest_well_known_types.proto +0 -112
- package/sandbox/gapi/googleapis/google/protobuf/unknown_enum_test.proto +0 -62
- package/sandbox/gapi/googleapis/google/protobuf/wrappers.proto +0 -117
- package/sandbox/gapi/googleapis/google/rpc/code.proto +0 -190
- package/sandbox/gapi/googleapis/google/rpc/error_details.proto +0 -157
- package/sandbox/gapi/googleapis/google/rpc/status.proto +0 -90
- package/sandbox/gapi/googleapis/google/type/color.proto +0 -163
- package/sandbox/gapi/googleapis/google/type/date.proto +0 -43
- package/sandbox/gapi/googleapis/google/type/dayofweek.proto +0 -50
- package/sandbox/gapi/googleapis/google/type/latlng.proto +0 -36
- package/sandbox/gapi/googleapis/google/type/money.proto +0 -40
- package/sandbox/gapi/googleapis/google/type/timeofday.proto +0 -42
- package/sandbox/gapi/test.js +0 -17
- package/sandbox/gapi/test.proto +0 -12
- package/sandbox/issue146/MyOptions.proto +0 -28
- package/sandbox/issue146/Sample.proto +0 -21
- package/sandbox/issue146/main.js +0 -3
- package/sandbox/issue147/enum.proto +0 -8
- package/sandbox/issue147/main.js +0 -3
- package/sandbox/issue182/commands.proto +0 -10
- package/sandbox/issue182/execute.js +0 -22
- package/sandbox/issue182/session_commands.proto +0 -14
- package/sandbox/issue289/A.proto +0 -8
- package/sandbox/issue289/B.proto +0 -8
- package/sandbox/issue289/common.proto +0 -5
- package/sandbox/issue289/main.js +0 -7
- package/sandbox/issue300/IAuth.proto +0 -14
- package/sandbox/issue300/Request.proto +0 -14
- package/sandbox/issue300/main.js +0 -26
- package/sandbox/issue347/index.js +0 -27
- package/sandbox/issue355/main.proto +0 -15
- package/sandbox/issue42/innerextend.proto +0 -18
- package/sandbox/issue42/main.js +0 -8
- package/sandbox/issue42/outerextend.proto +0 -17
|
@@ -1,120 +0,0 @@
|
|
|
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
|
-
// This file is mostly equivalent to map_unittest.proto, but imports
|
|
32
|
-
// unittest_proto3.proto instead of unittest.proto, so that it only
|
|
33
|
-
// uses proto3 messages. This makes it suitable for testing
|
|
34
|
-
// implementations which only support proto3.
|
|
35
|
-
// The TestRequiredMessageMap message has been removed as there are no
|
|
36
|
-
// required fields in proto3.
|
|
37
|
-
syntax = "proto3";
|
|
38
|
-
|
|
39
|
-
option cc_enable_arenas = true;
|
|
40
|
-
option csharp_namespace = "Google.Protobuf.TestProtos";
|
|
41
|
-
|
|
42
|
-
import "google/protobuf/unittest_proto3.proto";
|
|
43
|
-
|
|
44
|
-
// We don't put this in a package within proto2 because we need to make sure
|
|
45
|
-
// that the generated code doesn't depend on being in the proto2 namespace.
|
|
46
|
-
// In map_test_util.h we do "using namespace unittest = protobuf_unittest".
|
|
47
|
-
package protobuf_unittest;
|
|
48
|
-
|
|
49
|
-
// Tests maps.
|
|
50
|
-
message TestMap {
|
|
51
|
-
map<int32 , int32 > map_int32_int32 = 1;
|
|
52
|
-
map<int64 , int64 > map_int64_int64 = 2;
|
|
53
|
-
map<uint32 , uint32 > map_uint32_uint32 = 3;
|
|
54
|
-
map<uint64 , uint64 > map_uint64_uint64 = 4;
|
|
55
|
-
map<sint32 , sint32 > map_sint32_sint32 = 5;
|
|
56
|
-
map<sint64 , sint64 > map_sint64_sint64 = 6;
|
|
57
|
-
map<fixed32 , fixed32 > map_fixed32_fixed32 = 7;
|
|
58
|
-
map<fixed64 , fixed64 > map_fixed64_fixed64 = 8;
|
|
59
|
-
map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 9;
|
|
60
|
-
map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 10;
|
|
61
|
-
map<int32 , float > map_int32_float = 11;
|
|
62
|
-
map<int32 , double > map_int32_double = 12;
|
|
63
|
-
map<bool , bool > map_bool_bool = 13;
|
|
64
|
-
map<string , string > map_string_string = 14;
|
|
65
|
-
map<int32 , bytes > map_int32_bytes = 15;
|
|
66
|
-
map<int32 , MapEnum > map_int32_enum = 16;
|
|
67
|
-
map<int32 , ForeignMessage> map_int32_foreign_message = 17;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
message TestMapSubmessage {
|
|
71
|
-
TestMap test_map = 1;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
message TestMessageMap {
|
|
75
|
-
map<int32, TestAllTypes> map_int32_message = 1;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Two map fields share the same entry default instance.
|
|
79
|
-
message TestSameTypeMap {
|
|
80
|
-
map<int32, int32> map1 = 1;
|
|
81
|
-
map<int32, int32> map2 = 2;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
enum MapEnum {
|
|
85
|
-
MAP_ENUM_FOO = 0;
|
|
86
|
-
MAP_ENUM_BAR = 1;
|
|
87
|
-
MAP_ENUM_BAZ = 2;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
message TestArenaMap {
|
|
91
|
-
map<int32 , int32 > map_int32_int32 = 1;
|
|
92
|
-
map<int64 , int64 > map_int64_int64 = 2;
|
|
93
|
-
map<uint32 , uint32 > map_uint32_uint32 = 3;
|
|
94
|
-
map<uint64 , uint64 > map_uint64_uint64 = 4;
|
|
95
|
-
map<sint32 , sint32 > map_sint32_sint32 = 5;
|
|
96
|
-
map<sint64 , sint64 > map_sint64_sint64 = 6;
|
|
97
|
-
map<fixed32 , fixed32 > map_fixed32_fixed32 = 7;
|
|
98
|
-
map<fixed64 , fixed64 > map_fixed64_fixed64 = 8;
|
|
99
|
-
map<sfixed32, sfixed32> map_sfixed32_sfixed32 = 9;
|
|
100
|
-
map<sfixed64, sfixed64> map_sfixed64_sfixed64 = 10;
|
|
101
|
-
map<int32 , float > map_int32_float = 11;
|
|
102
|
-
map<int32 , double > map_int32_double = 12;
|
|
103
|
-
map<bool , bool > map_bool_bool = 13;
|
|
104
|
-
map<int32 , MapEnum > map_int32_enum = 14;
|
|
105
|
-
map<int32 , ForeignMessage> map_int32_foreign_message = 15;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Previously, message containing enum called Type cannot be used as value of
|
|
109
|
-
// map field.
|
|
110
|
-
message MessageContainingEnumCalledType {
|
|
111
|
-
enum Type {
|
|
112
|
-
TYPE_FOO = 0;
|
|
113
|
-
}
|
|
114
|
-
map<int32, MessageContainingEnumCalledType> type = 1;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Previously, message cannot contain map field called "entry".
|
|
118
|
-
message MessageContainingMapCalledEntry {
|
|
119
|
-
map<int32, int32> entry = 1;
|
|
120
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
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
|
-
syntax = "proto3";
|
|
31
|
-
|
|
32
|
-
package google.protobuf;
|
|
33
|
-
|
|
34
|
-
option java_multiple_files = true;
|
|
35
|
-
option java_outer_classname = "SourceContextProto";
|
|
36
|
-
option java_package = "com.google.protobuf";
|
|
37
|
-
option java_generate_equals_and_hash = true;
|
|
38
|
-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
|
39
|
-
option objc_class_prefix = "GPB";
|
|
40
|
-
|
|
41
|
-
// `SourceContext` represents information about the source of a
|
|
42
|
-
// protobuf element, like the file in which it is defined.
|
|
43
|
-
message SourceContext {
|
|
44
|
-
// The path-qualified name of the .proto file that contained the associated
|
|
45
|
-
// protobuf element. For example: `"google/protobuf/source.proto"`.
|
|
46
|
-
string file_name = 1;
|
|
47
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
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
|
-
syntax = "proto3";
|
|
31
|
-
|
|
32
|
-
package google.protobuf;
|
|
33
|
-
|
|
34
|
-
option java_generate_equals_and_hash = true;
|
|
35
|
-
option java_multiple_files = true;
|
|
36
|
-
option java_outer_classname = "StructProto";
|
|
37
|
-
option java_package = "com.google.protobuf";
|
|
38
|
-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
|
39
|
-
option objc_class_prefix = "GPB";
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// `Struct` represents a structured data value, consisting of fields
|
|
43
|
-
// which map to dynamically typed values. In some languages, `Struct`
|
|
44
|
-
// might be supported by a native representation. For example, in
|
|
45
|
-
// scripting languages like JS a struct is represented as an
|
|
46
|
-
// object. The details of that representation are described together
|
|
47
|
-
// with the proto support for the language.
|
|
48
|
-
//
|
|
49
|
-
// The JSON representation for `Struct` is JSON object.
|
|
50
|
-
message Struct {
|
|
51
|
-
// Map of dynamically typed values.
|
|
52
|
-
map<string, Value> fields = 1;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// `Value` represents a dynamically typed value which can be either
|
|
56
|
-
// null, a number, a string, a boolean, a recursive struct value, or a
|
|
57
|
-
// list of values. A producer of value is expected to set one of that
|
|
58
|
-
// variants, absence of any variant indicates an error.
|
|
59
|
-
//
|
|
60
|
-
// The JSON representation for `Value` is JSON value.
|
|
61
|
-
message Value {
|
|
62
|
-
// The kind of value.
|
|
63
|
-
oneof kind {
|
|
64
|
-
// Represents a null value.
|
|
65
|
-
NullValue null_value = 1;
|
|
66
|
-
// Represents a double value.
|
|
67
|
-
double number_value = 2;
|
|
68
|
-
// Represents a string value.
|
|
69
|
-
string string_value = 3;
|
|
70
|
-
// Represents a boolean value.
|
|
71
|
-
bool bool_value = 4;
|
|
72
|
-
// Represents a structured value.
|
|
73
|
-
Struct struct_value = 5;
|
|
74
|
-
// Represents a repeated `Value`.
|
|
75
|
-
ListValue list_value = 6;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// `NullValue` is a singleton enumeration to represent the null value for the
|
|
80
|
-
// `Value` type union.
|
|
81
|
-
//
|
|
82
|
-
// The JSON representation for `NullValue` is JSON `null`.
|
|
83
|
-
enum NullValue {
|
|
84
|
-
// Null value.
|
|
85
|
-
NULL_VALUE = 0;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// `ListValue` is a wrapper around a repeated field of values.
|
|
89
|
-
//
|
|
90
|
-
// The JSON representation for `ListValue` is JSON array.
|
|
91
|
-
message ListValue {
|
|
92
|
-
// Repeated field of dynamically typed values.
|
|
93
|
-
repeated Value values = 1;
|
|
94
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
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
|
-
syntax = "proto3";
|
|
31
|
-
|
|
32
|
-
package google.protobuf;
|
|
33
|
-
|
|
34
|
-
option java_generate_equals_and_hash = true;
|
|
35
|
-
option java_multiple_files = true;
|
|
36
|
-
option java_outer_classname = "TimestampProto";
|
|
37
|
-
option java_package = "com.google.protobuf";
|
|
38
|
-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
|
39
|
-
option objc_class_prefix = "GPB";
|
|
40
|
-
|
|
41
|
-
// A Timestamp represents a point in time independent of any time zone
|
|
42
|
-
// or calendar, represented as seconds and fractions of seconds at
|
|
43
|
-
// nanosecond resolution in UTC Epoch time. It is encoded using the
|
|
44
|
-
// Proleptic Gregorian Calendar which extends the Gregorian calendar
|
|
45
|
-
// backwards to year one. It is encoded assuming all minutes are 60
|
|
46
|
-
// seconds long, i.e. leap seconds are "smeared" so that no leap second
|
|
47
|
-
// table is needed for interpretation. Range is from
|
|
48
|
-
// 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
|
|
49
|
-
// By restricting to that range, we ensure that we can convert to
|
|
50
|
-
// and from RFC 3339 date strings.
|
|
51
|
-
// See [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt).
|
|
52
|
-
//
|
|
53
|
-
// Example 1: Compute Timestamp from POSIX `time()`.
|
|
54
|
-
//
|
|
55
|
-
// Timestamp timestamp;
|
|
56
|
-
// timestamp.set_seconds(time(NULL));
|
|
57
|
-
// timestamp.set_nanos(0);
|
|
58
|
-
//
|
|
59
|
-
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
60
|
-
//
|
|
61
|
-
// struct timeval tv;
|
|
62
|
-
// gettimeofday(&tv, NULL);
|
|
63
|
-
//
|
|
64
|
-
// Timestamp timestamp;
|
|
65
|
-
// timestamp.set_seconds(tv.tv_sec);
|
|
66
|
-
// timestamp.set_nanos(tv.tv_usec * 1000);
|
|
67
|
-
//
|
|
68
|
-
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
69
|
-
//
|
|
70
|
-
// FILETIME ft;
|
|
71
|
-
// GetSystemTimeAsFileTime(&ft);
|
|
72
|
-
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
73
|
-
//
|
|
74
|
-
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
75
|
-
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
76
|
-
// Timestamp timestamp;
|
|
77
|
-
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
78
|
-
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
79
|
-
//
|
|
80
|
-
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
81
|
-
//
|
|
82
|
-
// long millis = System.currentTimeMillis();
|
|
83
|
-
//
|
|
84
|
-
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
85
|
-
// .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
86
|
-
//
|
|
87
|
-
//
|
|
88
|
-
// Example 5: Compute Timestamp from current time in Python.
|
|
89
|
-
//
|
|
90
|
-
// now = time.time()
|
|
91
|
-
// seconds = int(now)
|
|
92
|
-
// nanos = int((now - seconds) * 10**9)
|
|
93
|
-
// timestamp = Timestamp(seconds=seconds, nanos=nanos)
|
|
94
|
-
//
|
|
95
|
-
message Timestamp {
|
|
96
|
-
|
|
97
|
-
// Represents seconds of UTC time since Unix epoch
|
|
98
|
-
// 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
|
|
99
|
-
// 9999-12-31T23:59:59Z inclusive.
|
|
100
|
-
int64 seconds = 1;
|
|
101
|
-
|
|
102
|
-
// Non-negative fractions of a second at nanosecond resolution. Negative
|
|
103
|
-
// second values with fractions must still have non-negative nanos values
|
|
104
|
-
// that count forward in time. Must be from 0 to 999,999,999
|
|
105
|
-
// inclusive.
|
|
106
|
-
int32 nanos = 2;
|
|
107
|
-
}
|
|
@@ -1,176 +0,0 @@
|
|
|
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
|
-
syntax = "proto3";
|
|
31
|
-
|
|
32
|
-
package google.protobuf;
|
|
33
|
-
|
|
34
|
-
import "google/protobuf/any.proto";
|
|
35
|
-
import "google/protobuf/source_context.proto";
|
|
36
|
-
|
|
37
|
-
option java_package = "com.google.protobuf";
|
|
38
|
-
option java_outer_classname = "TypeProto";
|
|
39
|
-
option java_multiple_files = true;
|
|
40
|
-
option java_generate_equals_and_hash = true;
|
|
41
|
-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
|
|
42
|
-
option objc_class_prefix = "GPB";
|
|
43
|
-
|
|
44
|
-
// A light-weight descriptor for a proto message type.
|
|
45
|
-
message Type {
|
|
46
|
-
// The fully qualified message name.
|
|
47
|
-
string name = 1;
|
|
48
|
-
// The list of fields.
|
|
49
|
-
repeated Field fields = 2;
|
|
50
|
-
// The list of oneof definitions.
|
|
51
|
-
repeated string oneofs = 3; // The list of oneofs declared in this Type
|
|
52
|
-
// The proto options.
|
|
53
|
-
repeated Option options = 4;
|
|
54
|
-
// The source context.
|
|
55
|
-
SourceContext source_context = 5;
|
|
56
|
-
// The source syntax.
|
|
57
|
-
Syntax syntax = 6;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Field represents a single field of a message type.
|
|
61
|
-
message Field {
|
|
62
|
-
// Kind represents a basic field type.
|
|
63
|
-
enum Kind {
|
|
64
|
-
// Field type unknown.
|
|
65
|
-
TYPE_UNKNOWN = 0;
|
|
66
|
-
// Field type double.
|
|
67
|
-
TYPE_DOUBLE = 1;
|
|
68
|
-
// Field type float.
|
|
69
|
-
TYPE_FLOAT = 2;
|
|
70
|
-
// Field type int64.
|
|
71
|
-
TYPE_INT64 = 3;
|
|
72
|
-
// Field type uint64.
|
|
73
|
-
TYPE_UINT64 = 4;
|
|
74
|
-
// Field type int32.
|
|
75
|
-
TYPE_INT32 = 5;
|
|
76
|
-
// Field type fixed64.
|
|
77
|
-
TYPE_FIXED64 = 6;
|
|
78
|
-
// Field type fixed32.
|
|
79
|
-
TYPE_FIXED32 = 7;
|
|
80
|
-
// Field type bool.
|
|
81
|
-
TYPE_BOOL = 8;
|
|
82
|
-
// Field type string.
|
|
83
|
-
TYPE_STRING = 9;
|
|
84
|
-
// Field type group (deprecated proto2 type)
|
|
85
|
-
TYPE_GROUP = 10;
|
|
86
|
-
// Field type message.
|
|
87
|
-
TYPE_MESSAGE = 11;
|
|
88
|
-
// Field type bytes.
|
|
89
|
-
TYPE_BYTES = 12;
|
|
90
|
-
// Field type uint32.
|
|
91
|
-
TYPE_UINT32 = 13;
|
|
92
|
-
// Field type enum.
|
|
93
|
-
TYPE_ENUM = 14;
|
|
94
|
-
// Field type sfixed32.
|
|
95
|
-
TYPE_SFIXED32 = 15;
|
|
96
|
-
// Field type sfixed64.
|
|
97
|
-
TYPE_SFIXED64 = 16;
|
|
98
|
-
// Field type sint32.
|
|
99
|
-
TYPE_SINT32 = 17;
|
|
100
|
-
// Field type sint64.
|
|
101
|
-
TYPE_SINT64 = 18;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
// Cardinality represents whether a field is optional, required, or
|
|
105
|
-
// repeated.
|
|
106
|
-
enum Cardinality {
|
|
107
|
-
// The field cardinality is unknown. Typically an error condition.
|
|
108
|
-
CARDINALITY_UNKNOWN = 0;
|
|
109
|
-
// For optional fields.
|
|
110
|
-
CARDINALITY_OPTIONAL = 1;
|
|
111
|
-
// For required fields. Not used for proto3.
|
|
112
|
-
CARDINALITY_REQUIRED = 2;
|
|
113
|
-
// For repeated fields.
|
|
114
|
-
CARDINALITY_REPEATED = 3;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// The field kind.
|
|
118
|
-
Kind kind = 1;
|
|
119
|
-
// The field cardinality, i.e. optional/required/repeated.
|
|
120
|
-
Cardinality cardinality = 2;
|
|
121
|
-
// The proto field number.
|
|
122
|
-
int32 number = 3;
|
|
123
|
-
// The field name.
|
|
124
|
-
string name = 4;
|
|
125
|
-
// The type URL (without the scheme) when the type is MESSAGE or ENUM,
|
|
126
|
-
// such as `type.googleapis.com/google.protobuf.Empty`.
|
|
127
|
-
string type_url = 6;
|
|
128
|
-
// Index in Type.oneofs. Starts at 1. Zero means no oneof mapping.
|
|
129
|
-
int32 oneof_index = 7;
|
|
130
|
-
// Whether to use alternative packed wire representation.
|
|
131
|
-
bool packed = 8;
|
|
132
|
-
// The proto options.
|
|
133
|
-
repeated Option options = 9;
|
|
134
|
-
// The JSON name for this field.
|
|
135
|
-
string json_name = 10;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Enum type definition.
|
|
139
|
-
message Enum {
|
|
140
|
-
// Enum type name.
|
|
141
|
-
string name = 1;
|
|
142
|
-
// Enum value definitions.
|
|
143
|
-
repeated EnumValue enumvalue = 2;
|
|
144
|
-
// Proto options for the enum type.
|
|
145
|
-
repeated Option options = 3;
|
|
146
|
-
// The source context.
|
|
147
|
-
SourceContext source_context = 4;
|
|
148
|
-
// The source syntax.
|
|
149
|
-
Syntax syntax = 5;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Enum value definition.
|
|
153
|
-
message EnumValue {
|
|
154
|
-
// Enum value name.
|
|
155
|
-
string name = 1;
|
|
156
|
-
// Enum value number.
|
|
157
|
-
int32 number = 2;
|
|
158
|
-
// Proto options for the enum value.
|
|
159
|
-
repeated Option options = 3;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Proto option attached to messages/fields/enums etc.
|
|
163
|
-
message Option {
|
|
164
|
-
// Proto option name.
|
|
165
|
-
string name = 1;
|
|
166
|
-
// Proto option value.
|
|
167
|
-
Any value = 2;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// Syntax specifies the syntax in which a service element was defined.
|
|
171
|
-
enum Syntax {
|
|
172
|
-
// Syntax "proto2"
|
|
173
|
-
SYNTAX_PROTO2 = 0;
|
|
174
|
-
// Syntax "proto3"
|
|
175
|
-
SYNTAX_PROTO3 = 1;
|
|
176
|
-
}
|