go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/common/proto/google/descutil/internal/util.proto (about) 1 // vim: noexpandtab 2 3 syntax = "proto3"; 4 5 package descutil; 6 7 import "google/protobuf/descriptor.proto"; 8 9 option go_package = "go.chromium.org/luci/common/proto/google/descutil/internal"; 10 11 message SuperExt { 12 string a = 1; 13 string b = 2; 14 } 15 16 extend google.protobuf.FieldOptions { 17 string ext = 50001; 18 19 SuperExt super_ext = 50002; 20 } 21 22 extend google.protobuf.MessageOptions { 23 string msgExt = 50001; 24 25 SuperExt super_msg_ext = 50002; 26 } 27 28 // Enum comment. 29 // next line. 30 enum E1 { 31 // V0 32 // next line. 33 V0 = 0; 34 // V1 35 // next line. 36 V1 = 1; 37 } 38 39 // M1 40 // next line. 41 message M1 { 42 // f1 43 // next line. 44 string f1 = 1 [ 45 json_name = "foof", 46 (ext) = "narf", 47 (super_ext) = { 48 a: "a" 49 b: "b" 50 } 51 ]; 52 repeated int64 meep = 2 [ 53 packed = false, 54 jstype = JS_NUMBER 55 ]; 56 bool regular_snake_case = 3; 57 bool only_json_name = 4 [json_name = "cool"]; 58 } 59 60 // M2 61 // next line. 62 message M2 { 63 option deprecated = true; 64 option (msgExt) = "yep"; 65 option (super_msg_ext) = { 66 a: "cool" 67 b: "beans" 68 }; 69 // f1 70 // next line. 71 repeated M1 f1 = 1; 72 // f2 73 // next line. 74 E1 f2 = 2; 75 } 76 77 // M3 78 message M3 { 79 // O1 80 oneof O1 { 81 // f1 82 int32 f1 = 1; 83 // f2 84 int32 f2 = 2; 85 } 86 // O2 87 oneof O2 { 88 // f3 89 int32 f3 = 3; 90 // f4 91 int32 f4 = 4; 92 } 93 // f5 94 string f5 = 5; 95 // f6 96 int32 f6 = 6; 97 } 98 99 100 // S1 101 service S1 { 102 // R1 103 rpc R1(M1) returns (M2) {}; 104 } 105 106 // S2 107 service S2 { 108 // R1 109 rpc R1(M1) returns (M2) {}; 110 // R2 111 rpc R2(M1) returns (M2) {}; 112 } 113 114 message NestedMessageParent { 115 message NestedMessage { 116 int32 f1 = 1; 117 int32 f2 = 2; 118 } 119 enum NestedEnum { 120 V0 = 0; 121 V1 = 1; 122 } 123 } 124 125 message ReservedRangeContainer { 126 reserved "hello"; 127 reserved "world"; 128 reserved 1; 129 reserved 2; 130 }