github.com/bakjos/protoreflect@v1.9.2/desc/protoprint/testfiles/test-non-files-compact.txt (about) 1 -------- desc_test_comments.proto (*desc.FileDescriptor) -------- 2 syntax = "proto2"; 3 package foo.bar; 4 import "desc_test_options.proto"; 5 import public "google/protobuf/empty.proto"; 6 option go_package = "github.com/bakjos/protoreflect/internal/testprotos"; 7 message AnEmptyMessage { 8 } 9 // We need a request for our RPC service below. 10 message Request { 11 option deprecated = true; 12 option (.testprotos.mfubar) = true; 13 // A field comment 14 repeated int32 ids = 1 [json_name = "|foo|", packed = true, (.testprotos.ffubar) = "abc", (.testprotos.ffubarb) = "xyz"]; 15 // label comment 16 optional string name = 2 [default = "fubar"]; 17 // Group comment 18 optional group Extras = 3 { 19 option no_standard_descriptor_accessor = false; 20 option (.testprotos.mfubar) = false; 21 optional double dbl = 1; 22 optional float flt = 2; 23 // Leading comment... 24 optional string str = 3; 25 } 26 // can be this or that 27 oneof abc { 28 string this = 4; 29 int32 that = 5; 30 } 31 // can be these or those 32 oneof xyz { 33 string these = 6; 34 int32 those = 7; 35 } 36 // map field 37 map<string, string> things = 8; 38 enum MarioCharacters { 39 option allow_alias = true; 40 option (.testprotos.efubar) = 123; 41 option (.testprotos.efubars) = -321; 42 SNIFIT = -101; 43 MARIO = 1 [(.testprotos.evfubar) = 278, (.testprotos.evfubars) = -314]; 44 LUIGI = 2 [(.testprotos.evfubaru) = 200, (.testprotos.evfubaruf) = 100]; 45 PEACH = 3; 46 BOWSER = 4; 47 WARIO = 5; 48 WALUIGI = 6; 49 HEY_HO = 7; 50 SHY_GUY = 7 [(.testprotos.evfubarsf) = 10101]; 51 KAMEK = 8; 52 MAGIKOOPA = 8; 53 } 54 extensions 100 to 200; 55 extensions 201 to 250 [(.testprotos.exfubar) = "splat!", (.testprotos.exfubarb) = "\000\001\002\003\004\005\006\007"]; 56 reserved 10 to 20, 30 to 50; 57 reserved "bar", "baz", "foo"; 58 } 59 // Service comment 60 service RpcService { 61 option deprecated = false; 62 option (.testprotos.sfubar) = { id:100 name:"bob" }; 63 option (.testprotos.sfubare) = VALUE; 64 // Method comment 65 rpc StreamingRpc ( stream .foo.bar.Request ) returns ( .foo.bar.Request ); 66 rpc UnaryRpc ( .foo.bar.Request ) returns ( .google.protobuf.Empty ) { 67 option deprecated = true; 68 option (.testprotos.mtfubar) = 12.340000; 69 option (.testprotos.mtfubard) = 123.456000; 70 } 71 } 72 extend .foo.bar.Request { 73 // comment for guid1 74 optional uint64 guid1 = 123; 75 // ... and a comment for guid2 76 optional uint64 guid2 = 124; 77 } 78 -------- foo.bar.Request (*desc.MessageDescriptor) -------- 79 // We need a request for our RPC service below. 80 message Request { 81 option deprecated = true; 82 option (.testprotos.mfubar) = true; 83 // A field comment 84 repeated int32 ids = 1 [json_name = "|foo|", packed = true, (.testprotos.ffubar) = "abc", (.testprotos.ffubarb) = "xyz"]; 85 // label comment 86 optional string name = 2 [default = "fubar"]; 87 // Group comment 88 optional group Extras = 3 { 89 option no_standard_descriptor_accessor = false; 90 option (.testprotos.mfubar) = false; 91 optional double dbl = 1; 92 optional float flt = 2; 93 // Leading comment... 94 optional string str = 3; 95 } 96 // can be this or that 97 oneof abc { 98 string this = 4; 99 int32 that = 5; 100 } 101 // can be these or those 102 oneof xyz { 103 string these = 6; 104 int32 those = 7; 105 } 106 // map field 107 map<string, string> things = 8; 108 enum MarioCharacters { 109 option allow_alias = true; 110 option (.testprotos.efubar) = 123; 111 option (.testprotos.efubars) = -321; 112 SNIFIT = -101; 113 MARIO = 1 [(.testprotos.evfubar) = 278, (.testprotos.evfubars) = -314]; 114 LUIGI = 2 [(.testprotos.evfubaru) = 200, (.testprotos.evfubaruf) = 100]; 115 PEACH = 3; 116 BOWSER = 4; 117 WARIO = 5; 118 WALUIGI = 6; 119 HEY_HO = 7; 120 SHY_GUY = 7 [(.testprotos.evfubarsf) = 10101]; 121 KAMEK = 8; 122 MAGIKOOPA = 8; 123 } 124 extensions 100 to 200; 125 extensions 201 to 250 [(.testprotos.exfubar) = "splat!", (.testprotos.exfubarb) = "\000\001\002\003\004\005\006\007"]; 126 reserved 10 to 20, 30 to 50; 127 reserved "bar", "baz", "foo"; 128 } 129 -------- foo.bar.Request.ids (*desc.FieldDescriptor) -------- 130 // A field comment 131 repeated int32 ids = 1 [json_name = "|foo|", packed = true, (.testprotos.ffubar) = "abc", (.testprotos.ffubarb) = "xyz"]; 132 -------- foo.bar.Request.name (*desc.FieldDescriptor) -------- 133 // label comment 134 optional string name = 2 [default = "fubar"]; 135 -------- foo.bar.Request.extras (*desc.FieldDescriptor) -------- 136 // Group comment 137 optional group Extras = 3 { 138 option no_standard_descriptor_accessor = false; 139 option (.testprotos.mfubar) = false; 140 optional double dbl = 1; 141 optional float flt = 2; 142 // Leading comment... 143 optional string str = 3; 144 } 145 -------- foo.bar.Request.this (*desc.FieldDescriptor) -------- 146 string this = 4; 147 -------- foo.bar.Request.that (*desc.FieldDescriptor) -------- 148 int32 that = 5; 149 -------- foo.bar.Request.these (*desc.FieldDescriptor) -------- 150 string these = 6; 151 -------- foo.bar.Request.those (*desc.FieldDescriptor) -------- 152 int32 those = 7; 153 -------- foo.bar.Request.things (*desc.FieldDescriptor) -------- 154 // map field 155 map<string, string> things = 8; 156 -------- foo.bar.Request.abc (*desc.OneOfDescriptor) -------- 157 oneof abc { 158 string this = 4; 159 int32 that = 5; 160 } 161 -------- foo.bar.Request.xyz (*desc.OneOfDescriptor) -------- 162 oneof xyz { 163 string these = 6; 164 int32 those = 7; 165 } 166 -------- foo.bar.Request.Extras (*desc.MessageDescriptor) -------- 167 // Group comment 168 message Extras { 169 option no_standard_descriptor_accessor = false; 170 option (.testprotos.mfubar) = false; 171 optional double dbl = 1; 172 optional float flt = 2; 173 // Leading comment... 174 optional string str = 3; 175 } 176 -------- foo.bar.Request.Extras.dbl (*desc.FieldDescriptor) -------- 177 optional double dbl = 1; 178 -------- foo.bar.Request.Extras.flt (*desc.FieldDescriptor) -------- 179 optional float flt = 2; 180 -------- foo.bar.Request.Extras.str (*desc.FieldDescriptor) -------- 181 // Leading comment... 182 optional string str = 3; 183 -------- foo.bar.Request.ThingsEntry (*desc.MessageDescriptor) -------- 184 message ThingsEntry { 185 option map_entry = true; 186 optional string key = 1; 187 optional string value = 2; 188 } 189 -------- foo.bar.Request.ThingsEntry.key (*desc.FieldDescriptor) -------- 190 optional string key = 1; 191 -------- foo.bar.Request.ThingsEntry.value (*desc.FieldDescriptor) -------- 192 optional string value = 2; 193 -------- foo.bar.Request.MarioCharacters (*desc.EnumDescriptor) -------- 194 enum MarioCharacters { 195 option allow_alias = true; 196 option (.testprotos.efubar) = 123; 197 option (.testprotos.efubars) = -321; 198 SNIFIT = -101; 199 MARIO = 1 [(.testprotos.evfubar) = 278, (.testprotos.evfubars) = -314]; 200 LUIGI = 2 [(.testprotos.evfubaru) = 200, (.testprotos.evfubaruf) = 100]; 201 PEACH = 3; 202 BOWSER = 4; 203 WARIO = 5; 204 WALUIGI = 6; 205 HEY_HO = 7; 206 SHY_GUY = 7 [(.testprotos.evfubarsf) = 10101]; 207 KAMEK = 8; 208 MAGIKOOPA = 8; 209 } 210 -------- foo.bar.Request.MarioCharacters.MARIO (*desc.EnumValueDescriptor) -------- 211 MARIO = 1 [(.testprotos.evfubar) = 278, (.testprotos.evfubars) = -314]; 212 -------- foo.bar.Request.MarioCharacters.LUIGI (*desc.EnumValueDescriptor) -------- 213 LUIGI = 2 [(.testprotos.evfubaru) = 200, (.testprotos.evfubaruf) = 100]; 214 -------- foo.bar.Request.MarioCharacters.PEACH (*desc.EnumValueDescriptor) -------- 215 PEACH = 3; 216 -------- foo.bar.Request.MarioCharacters.BOWSER (*desc.EnumValueDescriptor) -------- 217 BOWSER = 4; 218 -------- foo.bar.Request.MarioCharacters.WARIO (*desc.EnumValueDescriptor) -------- 219 WARIO = 5; 220 -------- foo.bar.Request.MarioCharacters.WALUIGI (*desc.EnumValueDescriptor) -------- 221 WALUIGI = 6; 222 -------- foo.bar.Request.MarioCharacters.SHY_GUY (*desc.EnumValueDescriptor) -------- 223 SHY_GUY = 7 [(.testprotos.evfubarsf) = 10101]; 224 -------- foo.bar.Request.MarioCharacters.HEY_HO (*desc.EnumValueDescriptor) -------- 225 HEY_HO = 7; 226 -------- foo.bar.Request.MarioCharacters.MAGIKOOPA (*desc.EnumValueDescriptor) -------- 227 MAGIKOOPA = 8; 228 -------- foo.bar.Request.MarioCharacters.KAMEK (*desc.EnumValueDescriptor) -------- 229 KAMEK = 8; 230 -------- foo.bar.Request.MarioCharacters.SNIFIT (*desc.EnumValueDescriptor) -------- 231 SNIFIT = -101; 232 -------- foo.bar.AnEmptyMessage (*desc.MessageDescriptor) -------- 233 message AnEmptyMessage { 234 } 235 -------- foo.bar.guid1 (*desc.FieldDescriptor) -------- 236 extend .foo.bar.Request { 237 // comment for guid1 238 optional uint64 guid1 = 123; 239 } 240 -------- foo.bar.guid2 (*desc.FieldDescriptor) -------- 241 extend .foo.bar.Request { 242 // ... and a comment for guid2 243 optional uint64 guid2 = 124; 244 } 245 -------- foo.bar.RpcService (*desc.ServiceDescriptor) -------- 246 // Service comment 247 service RpcService { 248 option deprecated = false; 249 option (.testprotos.sfubar) = { id:100 name:"bob" }; 250 option (.testprotos.sfubare) = VALUE; 251 // Method comment 252 rpc StreamingRpc ( stream .foo.bar.Request ) returns ( .foo.bar.Request ); 253 rpc UnaryRpc ( .foo.bar.Request ) returns ( .google.protobuf.Empty ) { 254 option deprecated = true; 255 option (.testprotos.mtfubar) = 12.340000; 256 option (.testprotos.mtfubard) = 123.456000; 257 } 258 } 259 -------- foo.bar.RpcService.StreamingRpc (*desc.MethodDescriptor) -------- 260 // Method comment 261 rpc StreamingRpc ( stream .foo.bar.Request ) returns ( .foo.bar.Request ); 262 -------- foo.bar.RpcService.UnaryRpc (*desc.MethodDescriptor) -------- 263 rpc UnaryRpc ( .foo.bar.Request ) returns ( .google.protobuf.Empty ) { 264 option deprecated = true; 265 option (.testprotos.mtfubar) = 12.340000; 266 option (.testprotos.mtfubard) = 123.456000; 267 }