2018-09-10 19:26:21 +00:00
|
|
|
// Copyright 2018 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
syntax = "proto2";
|
|
|
|
|
|
|
|
package goproto.protoc.proto2;
|
|
|
|
|
|
|
|
option go_package = "google.golang.org/proto/cmd/protoc-gen-go/testdata/proto2";
|
|
|
|
|
|
|
|
message FieldTestMessage {
|
2018-09-13 15:50:13 +00:00
|
|
|
optional bool optional_bool = 1;
|
2018-09-10 19:26:21 +00:00
|
|
|
optional Enum optional_enum = 2;
|
|
|
|
optional int32 optional_int32 = 3;
|
|
|
|
optional sint32 optional_sint32 = 4;
|
|
|
|
optional uint32 optional_uint32 = 5;
|
|
|
|
optional int64 optional_int64 = 6;
|
|
|
|
optional sint64 optional_sint64 = 7;
|
|
|
|
optional uint64 optional_uint64 = 8;
|
|
|
|
optional sfixed32 optional_sfixed32 = 9;
|
|
|
|
optional fixed32 optional_fixed32 = 10;
|
|
|
|
optional float optional_float = 11;
|
|
|
|
optional sfixed64 optional_sfixed64 = 12;
|
|
|
|
optional fixed64 optional_fixed64 = 13;
|
|
|
|
optional double optional_double = 14;
|
|
|
|
optional string optional_string = 15;
|
|
|
|
optional bytes optional_bytes = 16;
|
|
|
|
optional Message optional_Message = 17;
|
|
|
|
optional group OptionalGroup = 18 {
|
|
|
|
optional string optional_group = 19;
|
|
|
|
}
|
|
|
|
|
2018-09-13 15:50:13 +00:00
|
|
|
required bool required_bool = 101;
|
2018-09-10 19:26:21 +00:00
|
|
|
required Enum required_enum = 102;
|
|
|
|
required int32 required_int32 = 103;
|
|
|
|
required sint32 required_sint32 = 104;
|
|
|
|
required uint32 required_uint32 = 105;
|
|
|
|
required int64 required_int64 = 106;
|
|
|
|
required sint64 required_sint64 = 107;
|
|
|
|
required uint64 required_uint64 = 108;
|
|
|
|
required sfixed32 required_sfixed32 = 109;
|
|
|
|
required fixed32 required_fixed32 = 110;
|
|
|
|
required float required_float = 111;
|
|
|
|
required sfixed64 required_sfixed64 = 112;
|
|
|
|
required fixed64 required_fixed64 = 113;
|
|
|
|
required double required_double = 114;
|
|
|
|
required string required_string = 115;
|
|
|
|
required bytes required_bytes = 116;
|
|
|
|
required Message required_Message = 117;
|
|
|
|
required group RequiredGroup = 118 {
|
|
|
|
required string required_group = 119;
|
|
|
|
}
|
|
|
|
|
2018-09-13 15:50:13 +00:00
|
|
|
repeated bool repeated_bool = 201;
|
2018-09-10 19:26:21 +00:00
|
|
|
repeated Enum repeated_enum = 202;
|
|
|
|
repeated int32 repeated_int32 = 203;
|
|
|
|
repeated sint32 repeated_sint32 = 204;
|
|
|
|
repeated uint32 repeated_uint32 = 205;
|
|
|
|
repeated int64 repeated_int64 = 206;
|
|
|
|
repeated sint64 repeated_sint64 = 207;
|
|
|
|
repeated uint64 repeated_uint64 = 208;
|
|
|
|
repeated sfixed32 repeated_sfixed32 = 209;
|
|
|
|
repeated fixed32 repeated_fixed32 = 210;
|
|
|
|
repeated float repeated_float = 211;
|
|
|
|
repeated sfixed64 repeated_sfixed64 = 212;
|
|
|
|
repeated fixed64 repeated_fixed64 = 213;
|
|
|
|
repeated double repeated_double = 214;
|
|
|
|
repeated string repeated_string = 215;
|
|
|
|
repeated bytes repeated_bytes = 216;
|
|
|
|
repeated Message repeated_Message = 217;
|
|
|
|
repeated group RepeatedGroup = 218 {
|
|
|
|
repeated string repeated_group = 219;
|
|
|
|
}
|
|
|
|
|
2018-09-13 15:50:13 +00:00
|
|
|
optional bool default_bool = 301 [default=true];
|
|
|
|
optional Enum default_enum = 302 [default=ONE];
|
|
|
|
optional int32 default_int32 = 303 [default=1];
|
|
|
|
optional sint32 default_sint32 = 304 [default=1];
|
|
|
|
optional uint32 default_uint32 = 305 [default=1];
|
|
|
|
optional int64 default_int64 = 306 [default=1];
|
|
|
|
optional sint64 default_sint64 = 307 [default=1];
|
|
|
|
optional uint64 default_uint64 = 308 [default=1];
|
|
|
|
optional sfixed32 default_sfixed32 = 309 [default=1];
|
|
|
|
optional fixed32 default_fixed32 = 310 [default=1];
|
|
|
|
optional float default_float = 311 [default=1.5];
|
|
|
|
optional sfixed64 default_sfixed64 = 312 [default=1];
|
|
|
|
optional fixed64 default_fixed64 = 313 [default=1];
|
|
|
|
optional double default_double = 314 [default=1.5];
|
|
|
|
optional string default_string = 315 [default="x,y"];
|
|
|
|
optional bytes default_bytes = 316 [default="x,y"];
|
|
|
|
|
|
|
|
optional float default_float_neginf = 400 [default=-inf];
|
|
|
|
optional float default_float_posinf = 401 [default=inf];
|
|
|
|
optional float default_float_nan = 402 [default=nan];
|
|
|
|
optional double default_double_neginf = 403 [default=-inf];
|
|
|
|
optional double default_double_posinf = 404 [default=inf];
|
|
|
|
optional double default_double_nan = 405 [default=nan];
|
|
|
|
|
2018-09-13 22:07:10 +00:00
|
|
|
map<int32, int64> map_int32_int64 = 500;
|
|
|
|
map<string,Message> map_string_message = 501;
|
|
|
|
map<fixed64,Enum> map_fixed64_enum = 502;
|
|
|
|
|
2018-09-13 15:50:13 +00:00
|
|
|
enum Enum {
|
|
|
|
ZERO = 0;
|
|
|
|
ONE = 1;
|
|
|
|
}
|
2018-09-10 19:26:21 +00:00
|
|
|
message Message {}
|
|
|
|
}
|