github.com/syumai/protoreflect@v1.7.1-0.20200810020253-2ac7e3b3a321/internal/testprotos/desc_test_proto3.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // versions: 3 // protoc-gen-go v1.25.0 4 // protoc v3.12.0 5 // source: desc_test_proto3.proto 6 7 package testprotos 8 9 import ( 10 context "context" 11 proto "github.com/golang/protobuf/proto" 12 pkg "github.com/syumai/protoreflect/internal/testprotos/pkg" 13 grpc "google.golang.org/grpc" 14 codes "google.golang.org/grpc/codes" 15 status "google.golang.org/grpc/status" 16 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 17 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 18 reflect "reflect" 19 sync "sync" 20 ) 21 22 const ( 23 // Verify that this generated code is sufficiently up-to-date. 24 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 25 // Verify that runtime/protoimpl is sufficiently up-to-date. 26 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 27 ) 28 29 // This is a compile-time assertion that a sufficiently up-to-date version 30 // of the legacy proto package is being used. 31 const _ = proto.ProtoPackageIsVersion4 32 33 type Proto3Enum int32 34 35 const ( 36 Proto3Enum_UNKNOWN Proto3Enum = 0 37 Proto3Enum_VALUE1 Proto3Enum = 1 38 Proto3Enum_VALUE2 Proto3Enum = 2 39 ) 40 41 // Enum value maps for Proto3Enum. 42 var ( 43 Proto3Enum_name = map[int32]string{ 44 0: "UNKNOWN", 45 1: "VALUE1", 46 2: "VALUE2", 47 } 48 Proto3Enum_value = map[string]int32{ 49 "UNKNOWN": 0, 50 "VALUE1": 1, 51 "VALUE2": 2, 52 } 53 ) 54 55 func (x Proto3Enum) Enum() *Proto3Enum { 56 p := new(Proto3Enum) 57 *p = x 58 return p 59 } 60 61 func (x Proto3Enum) String() string { 62 return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) 63 } 64 65 func (Proto3Enum) Descriptor() protoreflect.EnumDescriptor { 66 return file_desc_test_proto3_proto_enumTypes[0].Descriptor() 67 } 68 69 func (Proto3Enum) Type() protoreflect.EnumType { 70 return &file_desc_test_proto3_proto_enumTypes[0] 71 } 72 73 func (x Proto3Enum) Number() protoreflect.EnumNumber { 74 return protoreflect.EnumNumber(x) 75 } 76 77 // Deprecated: Use Proto3Enum.Descriptor instead. 78 func (Proto3Enum) EnumDescriptor() ([]byte, []int) { 79 return file_desc_test_proto3_proto_rawDescGZIP(), []int{0} 80 } 81 82 type TestRequest struct { 83 state protoimpl.MessageState 84 sizeCache protoimpl.SizeCache 85 unknownFields protoimpl.UnknownFields 86 87 Foo []Proto3Enum `protobuf:"varint,1,rep,packed,name=foo,proto3,enum=testprotos.Proto3Enum" json:"foo,omitempty"` 88 Bar string `protobuf:"bytes,2,opt,name=bar,proto3" json:"bar,omitempty"` 89 Baz *TestMessage `protobuf:"bytes,3,opt,name=baz,proto3" json:"baz,omitempty"` 90 Snafu *TestMessage_NestedMessage_AnotherNestedMessage `protobuf:"bytes,4,opt,name=snafu,proto3" json:"snafu,omitempty"` 91 Flags map[string]bool `protobuf:"bytes,5,rep,name=flags,proto3" json:"flags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` 92 Others map[string]*TestMessage `protobuf:"bytes,6,rep,name=others,proto3" json:"others,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 93 } 94 95 func (x *TestRequest) Reset() { 96 *x = TestRequest{} 97 if protoimpl.UnsafeEnabled { 98 mi := &file_desc_test_proto3_proto_msgTypes[0] 99 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 100 ms.StoreMessageInfo(mi) 101 } 102 } 103 104 func (x *TestRequest) String() string { 105 return protoimpl.X.MessageStringOf(x) 106 } 107 108 func (*TestRequest) ProtoMessage() {} 109 110 func (x *TestRequest) ProtoReflect() protoreflect.Message { 111 mi := &file_desc_test_proto3_proto_msgTypes[0] 112 if protoimpl.UnsafeEnabled && x != nil { 113 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 114 if ms.LoadMessageInfo() == nil { 115 ms.StoreMessageInfo(mi) 116 } 117 return ms 118 } 119 return mi.MessageOf(x) 120 } 121 122 // Deprecated: Use TestRequest.ProtoReflect.Descriptor instead. 123 func (*TestRequest) Descriptor() ([]byte, []int) { 124 return file_desc_test_proto3_proto_rawDescGZIP(), []int{0} 125 } 126 127 func (x *TestRequest) GetFoo() []Proto3Enum { 128 if x != nil { 129 return x.Foo 130 } 131 return nil 132 } 133 134 func (x *TestRequest) GetBar() string { 135 if x != nil { 136 return x.Bar 137 } 138 return "" 139 } 140 141 func (x *TestRequest) GetBaz() *TestMessage { 142 if x != nil { 143 return x.Baz 144 } 145 return nil 146 } 147 148 func (x *TestRequest) GetSnafu() *TestMessage_NestedMessage_AnotherNestedMessage { 149 if x != nil { 150 return x.Snafu 151 } 152 return nil 153 } 154 155 func (x *TestRequest) GetFlags() map[string]bool { 156 if x != nil { 157 return x.Flags 158 } 159 return nil 160 } 161 162 func (x *TestRequest) GetOthers() map[string]*TestMessage { 163 if x != nil { 164 return x.Others 165 } 166 return nil 167 } 168 169 type TestResponse struct { 170 state protoimpl.MessageState 171 sizeCache protoimpl.SizeCache 172 unknownFields protoimpl.UnknownFields 173 174 Atm *AnotherTestMessage `protobuf:"bytes,1,opt,name=atm,proto3" json:"atm,omitempty"` 175 Vs []int32 `protobuf:"varint,2,rep,packed,name=vs,proto3" json:"vs,omitempty"` 176 } 177 178 func (x *TestResponse) Reset() { 179 *x = TestResponse{} 180 if protoimpl.UnsafeEnabled { 181 mi := &file_desc_test_proto3_proto_msgTypes[1] 182 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 183 ms.StoreMessageInfo(mi) 184 } 185 } 186 187 func (x *TestResponse) String() string { 188 return protoimpl.X.MessageStringOf(x) 189 } 190 191 func (*TestResponse) ProtoMessage() {} 192 193 func (x *TestResponse) ProtoReflect() protoreflect.Message { 194 mi := &file_desc_test_proto3_proto_msgTypes[1] 195 if protoimpl.UnsafeEnabled && x != nil { 196 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 197 if ms.LoadMessageInfo() == nil { 198 ms.StoreMessageInfo(mi) 199 } 200 return ms 201 } 202 return mi.MessageOf(x) 203 } 204 205 // Deprecated: Use TestResponse.ProtoReflect.Descriptor instead. 206 func (*TestResponse) Descriptor() ([]byte, []int) { 207 return file_desc_test_proto3_proto_rawDescGZIP(), []int{1} 208 } 209 210 func (x *TestResponse) GetAtm() *AnotherTestMessage { 211 if x != nil { 212 return x.Atm 213 } 214 return nil 215 } 216 217 func (x *TestResponse) GetVs() []int32 { 218 if x != nil { 219 return x.Vs 220 } 221 return nil 222 } 223 224 var File_desc_test_proto3_proto protoreflect.FileDescriptor 225 226 var file_desc_test_proto3_proto_rawDesc = []byte{ 227 0x0a, 0x16, 0x64, 0x65, 0x73, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x74, 228 0x6f, 0x33, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 229 0x6f, 0x74, 0x6f, 0x73, 0x1a, 0x10, 0x64, 0x65, 0x73, 0x63, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x31, 230 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x70, 0x6b, 0x67, 0x2f, 0x64, 0x65, 0x73, 0x63, 231 0x5f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x6b, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 232 0xcb, 0x03, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 233 0x28, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x74, 234 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x33, 235 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 236 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x62, 0x61, 0x72, 0x12, 0x29, 0x0a, 0x03, 0x62, 237 0x61, 0x7a, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 238 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 239 0x65, 0x52, 0x03, 0x62, 0x61, 0x7a, 0x12, 0x50, 0x0a, 0x05, 0x73, 0x6e, 0x61, 0x66, 0x75, 0x18, 240 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 241 0x6f, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4e, 242 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x41, 0x6e, 0x6f, 243 0x74, 0x68, 0x65, 0x72, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 244 0x65, 0x52, 0x05, 0x73, 0x6e, 0x61, 0x66, 0x75, 0x12, 0x38, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 245 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 246 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 247 0x2e, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x66, 0x6c, 0x61, 248 0x67, 0x73, 0x12, 0x3b, 0x0a, 0x06, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 249 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 250 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4f, 0x74, 0x68, 0x65, 251 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x1a, 252 0x38, 0x0a, 0x0a, 0x46, 0x6c, 0x61, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 253 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 254 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 255 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x52, 0x0a, 0x0b, 0x4f, 0x74, 0x68, 256 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 257 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, 0x0a, 0x05, 0x76, 0x61, 258 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x65, 0x73, 0x74, 259 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 260 0x67, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x50, 0x0a, 261 0x0c, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 262 0x03, 0x61, 0x74, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x74, 0x65, 0x73, 263 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x54, 264 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x03, 0x61, 0x74, 0x6d, 0x12, 265 0x0e, 0x0a, 0x02, 0x76, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x02, 0x76, 0x73, 0x2a, 266 0x31, 0x0a, 0x0a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0b, 0x0a, 267 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x56, 0x41, 268 0x4c, 0x55, 0x45, 0x31, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x32, 269 0x10, 0x02, 0x32, 0xbc, 0x02, 0x0a, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 270 0x63, 0x65, 0x12, 0x44, 0x0a, 0x0b, 0x44, 0x6f, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 271 0x67, 0x12, 0x17, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 272 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6a, 0x68, 0x75, 273 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x2e, 274 0x64, 0x65, 0x73, 0x63, 0x2e, 0x42, 0x61, 0x72, 0x12, 0x46, 0x0a, 0x0f, 0x44, 0x6f, 0x53, 0x6f, 275 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x45, 0x6c, 0x73, 0x65, 0x12, 0x17, 0x2e, 0x74, 0x65, 276 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 277 0x73, 0x61, 0x67, 0x65, 0x1a, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 278 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 279 0x12, 0x52, 0x0a, 0x10, 0x44, 0x6f, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x41, 280 0x67, 0x61, 0x69, 0x6e, 0x12, 0x1c, 0x2e, 0x6a, 0x68, 0x75, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 281 0x74, 0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x2e, 0x64, 0x65, 0x73, 0x63, 0x2e, 0x42, 282 0x61, 0x72, 0x1a, 0x1e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 283 0x41, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x54, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 284 0x67, 0x65, 0x30, 0x01, 0x12, 0x4b, 0x0a, 0x12, 0x44, 0x6f, 0x53, 0x6f, 0x6d, 0x65, 0x74, 0x68, 285 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x72, 0x65, 0x76, 0x65, 0x72, 0x12, 0x17, 0x2e, 0x74, 0x65, 0x73, 286 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 287 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 288 0x2e, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 289 0x01, 0x42, 0x33, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 290 0x6a, 0x68, 0x75, 0x6d, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 291 0x63, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 292 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 293 } 294 295 var ( 296 file_desc_test_proto3_proto_rawDescOnce sync.Once 297 file_desc_test_proto3_proto_rawDescData = file_desc_test_proto3_proto_rawDesc 298 ) 299 300 func file_desc_test_proto3_proto_rawDescGZIP() []byte { 301 file_desc_test_proto3_proto_rawDescOnce.Do(func() { 302 file_desc_test_proto3_proto_rawDescData = protoimpl.X.CompressGZIP(file_desc_test_proto3_proto_rawDescData) 303 }) 304 return file_desc_test_proto3_proto_rawDescData 305 } 306 307 var file_desc_test_proto3_proto_enumTypes = make([]protoimpl.EnumInfo, 1) 308 var file_desc_test_proto3_proto_msgTypes = make([]protoimpl.MessageInfo, 4) 309 var file_desc_test_proto3_proto_goTypes = []interface{}{ 310 (Proto3Enum)(0), // 0: testprotos.Proto3Enum 311 (*TestRequest)(nil), // 1: testprotos.TestRequest 312 (*TestResponse)(nil), // 2: testprotos.TestResponse 313 nil, // 3: testprotos.TestRequest.FlagsEntry 314 nil, // 4: testprotos.TestRequest.OthersEntry 315 (*TestMessage)(nil), // 5: testprotos.TestMessage 316 (*TestMessage_NestedMessage_AnotherNestedMessage)(nil), // 6: testprotos.TestMessage.NestedMessage.AnotherNestedMessage 317 (*AnotherTestMessage)(nil), // 7: testprotos.AnotherTestMessage 318 (*pkg.Bar)(nil), // 8: jhump.protoreflect.desc.Bar 319 } 320 var file_desc_test_proto3_proto_depIdxs = []int32{ 321 0, // 0: testprotos.TestRequest.foo:type_name -> testprotos.Proto3Enum 322 5, // 1: testprotos.TestRequest.baz:type_name -> testprotos.TestMessage 323 6, // 2: testprotos.TestRequest.snafu:type_name -> testprotos.TestMessage.NestedMessage.AnotherNestedMessage 324 3, // 3: testprotos.TestRequest.flags:type_name -> testprotos.TestRequest.FlagsEntry 325 4, // 4: testprotos.TestRequest.others:type_name -> testprotos.TestRequest.OthersEntry 326 7, // 5: testprotos.TestResponse.atm:type_name -> testprotos.AnotherTestMessage 327 5, // 6: testprotos.TestRequest.OthersEntry.value:type_name -> testprotos.TestMessage 328 1, // 7: testprotos.TestService.DoSomething:input_type -> testprotos.TestRequest 329 5, // 8: testprotos.TestService.DoSomethingElse:input_type -> testprotos.TestMessage 330 8, // 9: testprotos.TestService.DoSomethingAgain:input_type -> jhump.protoreflect.desc.Bar 331 1, // 10: testprotos.TestService.DoSomethingForever:input_type -> testprotos.TestRequest 332 8, // 11: testprotos.TestService.DoSomething:output_type -> jhump.protoreflect.desc.Bar 333 2, // 12: testprotos.TestService.DoSomethingElse:output_type -> testprotos.TestResponse 334 7, // 13: testprotos.TestService.DoSomethingAgain:output_type -> testprotos.AnotherTestMessage 335 2, // 14: testprotos.TestService.DoSomethingForever:output_type -> testprotos.TestResponse 336 11, // [11:15] is the sub-list for method output_type 337 7, // [7:11] is the sub-list for method input_type 338 7, // [7:7] is the sub-list for extension type_name 339 7, // [7:7] is the sub-list for extension extendee 340 0, // [0:7] is the sub-list for field type_name 341 } 342 343 func init() { file_desc_test_proto3_proto_init() } 344 func file_desc_test_proto3_proto_init() { 345 if File_desc_test_proto3_proto != nil { 346 return 347 } 348 file_desc_test1_proto_init() 349 if !protoimpl.UnsafeEnabled { 350 file_desc_test_proto3_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 351 switch v := v.(*TestRequest); i { 352 case 0: 353 return &v.state 354 case 1: 355 return &v.sizeCache 356 case 2: 357 return &v.unknownFields 358 default: 359 return nil 360 } 361 } 362 file_desc_test_proto3_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 363 switch v := v.(*TestResponse); i { 364 case 0: 365 return &v.state 366 case 1: 367 return &v.sizeCache 368 case 2: 369 return &v.unknownFields 370 default: 371 return nil 372 } 373 } 374 } 375 type x struct{} 376 out := protoimpl.TypeBuilder{ 377 File: protoimpl.DescBuilder{ 378 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 379 RawDescriptor: file_desc_test_proto3_proto_rawDesc, 380 NumEnums: 1, 381 NumMessages: 4, 382 NumExtensions: 0, 383 NumServices: 1, 384 }, 385 GoTypes: file_desc_test_proto3_proto_goTypes, 386 DependencyIndexes: file_desc_test_proto3_proto_depIdxs, 387 EnumInfos: file_desc_test_proto3_proto_enumTypes, 388 MessageInfos: file_desc_test_proto3_proto_msgTypes, 389 }.Build() 390 File_desc_test_proto3_proto = out.File 391 file_desc_test_proto3_proto_rawDesc = nil 392 file_desc_test_proto3_proto_goTypes = nil 393 file_desc_test_proto3_proto_depIdxs = nil 394 } 395 396 // Reference imports to suppress errors if they are not otherwise used. 397 var _ context.Context 398 var _ grpc.ClientConnInterface 399 400 // This is a compile-time assertion to ensure that this generated file 401 // is compatible with the grpc package it is being compiled against. 402 const _ = grpc.SupportPackageIsVersion6 403 404 // TestServiceClient is the client API for TestService service. 405 // 406 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 407 type TestServiceClient interface { 408 DoSomething(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*pkg.Bar, error) 409 DoSomethingElse(ctx context.Context, opts ...grpc.CallOption) (TestService_DoSomethingElseClient, error) 410 DoSomethingAgain(ctx context.Context, in *pkg.Bar, opts ...grpc.CallOption) (TestService_DoSomethingAgainClient, error) 411 DoSomethingForever(ctx context.Context, opts ...grpc.CallOption) (TestService_DoSomethingForeverClient, error) 412 } 413 414 type testServiceClient struct { 415 cc grpc.ClientConnInterface 416 } 417 418 func NewTestServiceClient(cc grpc.ClientConnInterface) TestServiceClient { 419 return &testServiceClient{cc} 420 } 421 422 func (c *testServiceClient) DoSomething(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (*pkg.Bar, error) { 423 out := new(pkg.Bar) 424 err := c.cc.Invoke(ctx, "/testprotos.TestService/DoSomething", in, out, opts...) 425 if err != nil { 426 return nil, err 427 } 428 return out, nil 429 } 430 431 func (c *testServiceClient) DoSomethingElse(ctx context.Context, opts ...grpc.CallOption) (TestService_DoSomethingElseClient, error) { 432 stream, err := c.cc.NewStream(ctx, &_TestService_serviceDesc.Streams[0], "/testprotos.TestService/DoSomethingElse", opts...) 433 if err != nil { 434 return nil, err 435 } 436 x := &testServiceDoSomethingElseClient{stream} 437 return x, nil 438 } 439 440 type TestService_DoSomethingElseClient interface { 441 Send(*TestMessage) error 442 CloseAndRecv() (*TestResponse, error) 443 grpc.ClientStream 444 } 445 446 type testServiceDoSomethingElseClient struct { 447 grpc.ClientStream 448 } 449 450 func (x *testServiceDoSomethingElseClient) Send(m *TestMessage) error { 451 return x.ClientStream.SendMsg(m) 452 } 453 454 func (x *testServiceDoSomethingElseClient) CloseAndRecv() (*TestResponse, error) { 455 if err := x.ClientStream.CloseSend(); err != nil { 456 return nil, err 457 } 458 m := new(TestResponse) 459 if err := x.ClientStream.RecvMsg(m); err != nil { 460 return nil, err 461 } 462 return m, nil 463 } 464 465 func (c *testServiceClient) DoSomethingAgain(ctx context.Context, in *pkg.Bar, opts ...grpc.CallOption) (TestService_DoSomethingAgainClient, error) { 466 stream, err := c.cc.NewStream(ctx, &_TestService_serviceDesc.Streams[1], "/testprotos.TestService/DoSomethingAgain", opts...) 467 if err != nil { 468 return nil, err 469 } 470 x := &testServiceDoSomethingAgainClient{stream} 471 if err := x.ClientStream.SendMsg(in); err != nil { 472 return nil, err 473 } 474 if err := x.ClientStream.CloseSend(); err != nil { 475 return nil, err 476 } 477 return x, nil 478 } 479 480 type TestService_DoSomethingAgainClient interface { 481 Recv() (*AnotherTestMessage, error) 482 grpc.ClientStream 483 } 484 485 type testServiceDoSomethingAgainClient struct { 486 grpc.ClientStream 487 } 488 489 func (x *testServiceDoSomethingAgainClient) Recv() (*AnotherTestMessage, error) { 490 m := new(AnotherTestMessage) 491 if err := x.ClientStream.RecvMsg(m); err != nil { 492 return nil, err 493 } 494 return m, nil 495 } 496 497 func (c *testServiceClient) DoSomethingForever(ctx context.Context, opts ...grpc.CallOption) (TestService_DoSomethingForeverClient, error) { 498 stream, err := c.cc.NewStream(ctx, &_TestService_serviceDesc.Streams[2], "/testprotos.TestService/DoSomethingForever", opts...) 499 if err != nil { 500 return nil, err 501 } 502 x := &testServiceDoSomethingForeverClient{stream} 503 return x, nil 504 } 505 506 type TestService_DoSomethingForeverClient interface { 507 Send(*TestRequest) error 508 Recv() (*TestResponse, error) 509 grpc.ClientStream 510 } 511 512 type testServiceDoSomethingForeverClient struct { 513 grpc.ClientStream 514 } 515 516 func (x *testServiceDoSomethingForeverClient) Send(m *TestRequest) error { 517 return x.ClientStream.SendMsg(m) 518 } 519 520 func (x *testServiceDoSomethingForeverClient) Recv() (*TestResponse, error) { 521 m := new(TestResponse) 522 if err := x.ClientStream.RecvMsg(m); err != nil { 523 return nil, err 524 } 525 return m, nil 526 } 527 528 // TestServiceServer is the server API for TestService service. 529 type TestServiceServer interface { 530 DoSomething(context.Context, *TestRequest) (*pkg.Bar, error) 531 DoSomethingElse(TestService_DoSomethingElseServer) error 532 DoSomethingAgain(*pkg.Bar, TestService_DoSomethingAgainServer) error 533 DoSomethingForever(TestService_DoSomethingForeverServer) error 534 } 535 536 // UnimplementedTestServiceServer can be embedded to have forward compatible implementations. 537 type UnimplementedTestServiceServer struct { 538 } 539 540 func (*UnimplementedTestServiceServer) DoSomething(context.Context, *TestRequest) (*pkg.Bar, error) { 541 return nil, status.Errorf(codes.Unimplemented, "method DoSomething not implemented") 542 } 543 func (*UnimplementedTestServiceServer) DoSomethingElse(TestService_DoSomethingElseServer) error { 544 return status.Errorf(codes.Unimplemented, "method DoSomethingElse not implemented") 545 } 546 func (*UnimplementedTestServiceServer) DoSomethingAgain(*pkg.Bar, TestService_DoSomethingAgainServer) error { 547 return status.Errorf(codes.Unimplemented, "method DoSomethingAgain not implemented") 548 } 549 func (*UnimplementedTestServiceServer) DoSomethingForever(TestService_DoSomethingForeverServer) error { 550 return status.Errorf(codes.Unimplemented, "method DoSomethingForever not implemented") 551 } 552 553 func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer) { 554 s.RegisterService(&_TestService_serviceDesc, srv) 555 } 556 557 func _TestService_DoSomething_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 558 in := new(TestRequest) 559 if err := dec(in); err != nil { 560 return nil, err 561 } 562 if interceptor == nil { 563 return srv.(TestServiceServer).DoSomething(ctx, in) 564 } 565 info := &grpc.UnaryServerInfo{ 566 Server: srv, 567 FullMethod: "/testprotos.TestService/DoSomething", 568 } 569 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 570 return srv.(TestServiceServer).DoSomething(ctx, req.(*TestRequest)) 571 } 572 return interceptor(ctx, in, info, handler) 573 } 574 575 func _TestService_DoSomethingElse_Handler(srv interface{}, stream grpc.ServerStream) error { 576 return srv.(TestServiceServer).DoSomethingElse(&testServiceDoSomethingElseServer{stream}) 577 } 578 579 type TestService_DoSomethingElseServer interface { 580 SendAndClose(*TestResponse) error 581 Recv() (*TestMessage, error) 582 grpc.ServerStream 583 } 584 585 type testServiceDoSomethingElseServer struct { 586 grpc.ServerStream 587 } 588 589 func (x *testServiceDoSomethingElseServer) SendAndClose(m *TestResponse) error { 590 return x.ServerStream.SendMsg(m) 591 } 592 593 func (x *testServiceDoSomethingElseServer) Recv() (*TestMessage, error) { 594 m := new(TestMessage) 595 if err := x.ServerStream.RecvMsg(m); err != nil { 596 return nil, err 597 } 598 return m, nil 599 } 600 601 func _TestService_DoSomethingAgain_Handler(srv interface{}, stream grpc.ServerStream) error { 602 m := new(pkg.Bar) 603 if err := stream.RecvMsg(m); err != nil { 604 return err 605 } 606 return srv.(TestServiceServer).DoSomethingAgain(m, &testServiceDoSomethingAgainServer{stream}) 607 } 608 609 type TestService_DoSomethingAgainServer interface { 610 Send(*AnotherTestMessage) error 611 grpc.ServerStream 612 } 613 614 type testServiceDoSomethingAgainServer struct { 615 grpc.ServerStream 616 } 617 618 func (x *testServiceDoSomethingAgainServer) Send(m *AnotherTestMessage) error { 619 return x.ServerStream.SendMsg(m) 620 } 621 622 func _TestService_DoSomethingForever_Handler(srv interface{}, stream grpc.ServerStream) error { 623 return srv.(TestServiceServer).DoSomethingForever(&testServiceDoSomethingForeverServer{stream}) 624 } 625 626 type TestService_DoSomethingForeverServer interface { 627 Send(*TestResponse) error 628 Recv() (*TestRequest, error) 629 grpc.ServerStream 630 } 631 632 type testServiceDoSomethingForeverServer struct { 633 grpc.ServerStream 634 } 635 636 func (x *testServiceDoSomethingForeverServer) Send(m *TestResponse) error { 637 return x.ServerStream.SendMsg(m) 638 } 639 640 func (x *testServiceDoSomethingForeverServer) Recv() (*TestRequest, error) { 641 m := new(TestRequest) 642 if err := x.ServerStream.RecvMsg(m); err != nil { 643 return nil, err 644 } 645 return m, nil 646 } 647 648 var _TestService_serviceDesc = grpc.ServiceDesc{ 649 ServiceName: "testprotos.TestService", 650 HandlerType: (*TestServiceServer)(nil), 651 Methods: []grpc.MethodDesc{ 652 { 653 MethodName: "DoSomething", 654 Handler: _TestService_DoSomething_Handler, 655 }, 656 }, 657 Streams: []grpc.StreamDesc{ 658 { 659 StreamName: "DoSomethingElse", 660 Handler: _TestService_DoSomethingElse_Handler, 661 ClientStreams: true, 662 }, 663 { 664 StreamName: "DoSomethingAgain", 665 Handler: _TestService_DoSomethingAgain_Handler, 666 ServerStreams: true, 667 }, 668 { 669 StreamName: "DoSomethingForever", 670 Handler: _TestService_DoSomethingForever_Handler, 671 ServerStreams: true, 672 ClientStreams: true, 673 }, 674 }, 675 Metadata: "desc_test_proto3.proto", 676 }