| 1 |
syntax = "proto3"; |
| 2 |
|
| 3 |
package google.expr.proto3.test; |
| 4 |
|
| 5 |
option go_package = "github.com/google/cel-go/test/proto3pb"; |
| 6 |
|
| 7 |
import "google/protobuf/any.proto"; |
| 8 |
import "google/protobuf/duration.proto"; |
| 9 |
import "google/protobuf/struct.proto"; |
| 10 |
import "google/protobuf/timestamp.proto"; |
| 11 |
import "google/protobuf/wrappers.proto"; |
| 12 |
|
| 13 |
// Imported message dependency test. |
| 14 |
import "test/proto3pb/test_import.proto"; |
| 15 |
|
| 16 |
// This proto includes every type of field in both singular and repeated |
| 17 |
// forms. |
| 18 |
message TestAllTypes { |
| 19 |
message NestedMessage { |
| 20 |
// The field name "b" fails to compile in proto1 because it conflicts with |
| 21 |
// a local variable named "b" in one of the generated methods. |
| 22 |
// This file needs to compile in proto1 to test backwards-compatibility. |
| 23 |
int32 bb = 1; |
| 24 |
} |
| 25 |
|
| 26 |
enum NestedEnum { |
| 27 |
FOO = 0; |
| 28 |
BAR = 1; |
| 29 |
BAZ = 2; |
| 30 |
} |
| 31 |
|
| 32 |
// Singular |
| 33 |
int32 single_int32 = 1; |
| 34 |
int64 single_int64 = 2; |
| 35 |
uint32 single_uint32 = 3; |
| 36 |
uint64 single_uint64 = 4; |
| 37 |
sint32 single_sint32 = 5; |
| 38 |
sint64 single_sint64 = 6; |
| 39 |
fixed32 single_fixed32 = 7; |
| 40 |
fixed64 single_fixed64 = 8; |
| 41 |
sfixed32 single_sfixed32 = 9; |
| 42 |
sfixed64 single_sfixed64 = 10; |
| 43 |
float single_float = 11; |
| 44 |
double single_double = 12; |
| 45 |
bool single_bool = 13; |
| 46 |
string single_string = 14; |
| 47 |
bytes single_bytes = 15; |
| 48 |
NestedEnum standalone_enum = 22; |
| 49 |
|
| 50 |
// Wellknown. |
| 51 |
google.protobuf.Any single_any = 100; |
| 52 |
google.protobuf.Duration single_duration = 101; |
| 53 |
google.protobuf.Timestamp single_timestamp = 102; |
| 54 |
google.protobuf.Struct single_struct = 103; |
| 55 |
google.protobuf.Value single_value = 104; |
| 56 |
google.protobuf.Int64Value single_int64_wrapper = 105; |
| 57 |
google.protobuf.Int32Value single_int32_wrapper = 106; |
| 58 |
google.protobuf.DoubleValue single_double_wrapper = 107; |
| 59 |
google.protobuf.FloatValue single_float_wrapper = 108; |
| 60 |
google.protobuf.UInt64Value single_uint64_wrapper = 109; |
| 61 |
google.protobuf.UInt32Value single_uint32_wrapper = 110; |
| 62 |
google.protobuf.StringValue single_string_wrapper = 111; |
| 63 |
google.protobuf.BoolValue single_bool_wrapper = 112; |
| 64 |
google.protobuf.BytesValue single_bytes_wrapper = 113; |
| 65 |
|
| 66 |
// Nested messages |
| 67 |
oneof nested_type { |
| 68 |
NestedMessage single_nested_message = 18; |
| 69 |
NestedEnum single_nested_enum = 21; |
| 70 |
} |
| 71 |
|
| 72 |
// Repeated |
| 73 |
repeated int32 repeated_int32 = 31; |
| 74 |
repeated int64 repeated_int64 = 32; |
| 75 |
repeated uint32 repeated_uint32 = 33; |
| 76 |
repeated uint64 repeated_uint64 = 34; |
| 77 |
repeated sint32 repeated_sint32 = 35; |
| 78 |
repeated sint64 repeated_sint64 = 36; |
| 79 |
repeated fixed32 repeated_fixed32 = 37; |
| 80 |
repeated fixed64 repeated_fixed64 = 38; |
| 81 |
repeated sfixed32 repeated_sfixed32 = 39; |
| 82 |
repeated sfixed64 repeated_sfixed64 = 40; |
| 83 |
repeated float repeated_float = 41; |
| 84 |
repeated double repeated_double = 42; |
| 85 |
repeated bool repeated_bool = 43; |
| 86 |
repeated string repeated_string = 44; |
| 87 |
repeated bytes repeated_bytes = 45; |
| 88 |
|
| 89 |
repeated NestedMessage repeated_nested_message = 48; |
| 90 |
|
| 91 |
repeated NestedEnum repeated_nested_enum = 51; |
| 92 |
|
| 93 |
repeated string repeated_string_piece = 54 [ctype = STRING_PIECE]; |
| 94 |
repeated string repeated_cord = 55 [ctype = CORD]; |
| 95 |
|
| 96 |
repeated NestedMessage repeated_lazy_message = 57; |
| 97 |
|
| 98 |
// Map |
| 99 |
map<string, string> map_string_string = 58; |
| 100 |
map<int64, NestedTestAllTypes> map_int64_nested_type = 59; |
| 101 |
|
| 102 |
// Imports |
| 103 |
repeated ImportedGlobalEnum imported_enums = 60; |
| 104 |
} |
| 105 |
|
| 106 |
// This proto includes a recursively nested message. |
| 107 |
message NestedTestAllTypes { |
| 108 |
NestedTestAllTypes child = 1; |
| 109 |
TestAllTypes payload = 2; |
| 110 |
} |
| 111 |
|
| 112 |
// This proto tests that global enums are resolved correctly. |
| 113 |
enum GlobalEnum { |
| 114 |
GOO = 0; |
| 115 |
GAR = 1; |
| 116 |
GAZ = 2; |
| 117 |
} |