google.golang.org/grpc@v1.62.1/reflection/grpc_testing_not_regenerate/testv3.go (about) 1 /* 2 * Copyright 2022 gRPC authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 18 // Code generated by protoc-gen-go. 19 // source: testv3.proto 20 // DO NOT EDIT! 21 22 /* 23 Package grpc_testing_not_regenerate is a generated protocol buffer package. 24 25 It is generated from these files: 26 27 testv3.proto 28 29 It has these top-level messages: 30 31 SearchResponseV3 32 SearchRequestV3 33 */ 34 package grpc_testing_not_regenerate 35 36 import ( 37 context "context" 38 fmt "fmt" 39 math "math" 40 41 proto "github.com/golang/protobuf/proto" 42 grpc "google.golang.org/grpc" 43 ) 44 45 // Reference imports to suppress errors if they are not otherwise used. 46 var _ = proto.Marshal 47 var _ = fmt.Errorf 48 var _ = math.Inf 49 50 // This is a compile-time assertion to ensure that this generated file 51 // is compatible with the proto package it is being compiled against. 52 // A compilation error at this line likely means your copy of the 53 // proto package needs to be updated. 54 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 55 56 type SearchResponseV3_State int32 57 58 const ( 59 SearchResponseV3_UNKNOWN SearchResponseV3_State = 0 60 SearchResponseV3_FRESH SearchResponseV3_State = 1 61 SearchResponseV3_STALE SearchResponseV3_State = 2 62 ) 63 64 var SearchResponseV3_State_name = map[int32]string{ 65 0: "UNKNOWN", 66 1: "FRESH", 67 2: "STALE", 68 } 69 var SearchResponseV3_State_value = map[string]int32{ 70 "UNKNOWN": 0, 71 "FRESH": 1, 72 "STALE": 2, 73 } 74 75 func (x SearchResponseV3_State) String() string { 76 return proto.EnumName(SearchResponseV3_State_name, int32(x)) 77 } 78 func (SearchResponseV3_State) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } 79 80 type SearchResponseV3 struct { 81 Results []*SearchResponseV3_Result `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"` 82 State SearchResponseV3_State `protobuf:"varint,2,opt,name=state,enum=grpc.testingv3.SearchResponseV3_State" json:"state,omitempty"` 83 } 84 85 func (m *SearchResponseV3) Reset() { *m = SearchResponseV3{} } 86 func (m *SearchResponseV3) String() string { return proto.CompactTextString(m) } 87 func (*SearchResponseV3) ProtoMessage() {} 88 func (*SearchResponseV3) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } 89 90 func (m *SearchResponseV3) GetResults() []*SearchResponseV3_Result { 91 if m != nil { 92 return m.Results 93 } 94 return nil 95 } 96 97 func (m *SearchResponseV3) GetState() SearchResponseV3_State { 98 if m != nil { 99 return m.State 100 } 101 return SearchResponseV3_UNKNOWN 102 } 103 104 type SearchResponseV3_Result struct { 105 Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"` 106 Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` 107 Snippets []string `protobuf:"bytes,3,rep,name=snippets" json:"snippets,omitempty"` 108 Metadata map[string]*SearchResponseV3_Result_Value `protobuf:"bytes,4,rep,name=metadata" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` 109 } 110 111 func (m *SearchResponseV3_Result) Reset() { *m = SearchResponseV3_Result{} } 112 func (m *SearchResponseV3_Result) String() string { return proto.CompactTextString(m) } 113 func (*SearchResponseV3_Result) ProtoMessage() {} 114 func (*SearchResponseV3_Result) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } 115 116 func (m *SearchResponseV3_Result) GetUrl() string { 117 if m != nil { 118 return m.Url 119 } 120 return "" 121 } 122 123 func (m *SearchResponseV3_Result) GetTitle() string { 124 if m != nil { 125 return m.Title 126 } 127 return "" 128 } 129 130 func (m *SearchResponseV3_Result) GetSnippets() []string { 131 if m != nil { 132 return m.Snippets 133 } 134 return nil 135 } 136 137 func (m *SearchResponseV3_Result) GetMetadata() map[string]*SearchResponseV3_Result_Value { 138 if m != nil { 139 return m.Metadata 140 } 141 return nil 142 } 143 144 type SearchResponseV3_Result_Value struct { 145 // Types that are valid to be assigned to Val: 146 // *SearchResponseV3_Result_Value_Str 147 // *SearchResponseV3_Result_Value_Int 148 // *SearchResponseV3_Result_Value_Real 149 Val isSearchResponseV3_Result_Value_Val `protobuf_oneof:"val"` 150 } 151 152 func (m *SearchResponseV3_Result_Value) Reset() { *m = SearchResponseV3_Result_Value{} } 153 func (m *SearchResponseV3_Result_Value) String() string { return proto.CompactTextString(m) } 154 func (*SearchResponseV3_Result_Value) ProtoMessage() {} 155 func (*SearchResponseV3_Result_Value) Descriptor() ([]byte, []int) { 156 return fileDescriptor0, []int{0, 0, 0} 157 } 158 159 type isSearchResponseV3_Result_Value_Val interface { 160 isSearchResponseV3_Result_Value_Val() 161 } 162 163 type SearchResponseV3_Result_Value_Str struct { 164 Str string `protobuf:"bytes,1,opt,name=str,oneof"` 165 } 166 type SearchResponseV3_Result_Value_Int struct { 167 Int int64 `protobuf:"varint,2,opt,name=int,oneof"` 168 } 169 type SearchResponseV3_Result_Value_Real struct { 170 Real float64 `protobuf:"fixed64,3,opt,name=real,oneof"` 171 } 172 173 func (*SearchResponseV3_Result_Value_Str) isSearchResponseV3_Result_Value_Val() {} 174 func (*SearchResponseV3_Result_Value_Int) isSearchResponseV3_Result_Value_Val() {} 175 func (*SearchResponseV3_Result_Value_Real) isSearchResponseV3_Result_Value_Val() {} 176 177 func (m *SearchResponseV3_Result_Value) GetVal() isSearchResponseV3_Result_Value_Val { 178 if m != nil { 179 return m.Val 180 } 181 return nil 182 } 183 184 func (m *SearchResponseV3_Result_Value) GetStr() string { 185 if x, ok := m.GetVal().(*SearchResponseV3_Result_Value_Str); ok { 186 return x.Str 187 } 188 return "" 189 } 190 191 func (m *SearchResponseV3_Result_Value) GetInt() int64 { 192 if x, ok := m.GetVal().(*SearchResponseV3_Result_Value_Int); ok { 193 return x.Int 194 } 195 return 0 196 } 197 198 func (m *SearchResponseV3_Result_Value) GetReal() float64 { 199 if x, ok := m.GetVal().(*SearchResponseV3_Result_Value_Real); ok { 200 return x.Real 201 } 202 return 0 203 } 204 205 // XXX_OneofFuncs is for the internal use of the proto package. 206 func (*SearchResponseV3_Result_Value) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 207 return _SearchResponseV3_Result_Value_OneofMarshaler, _SearchResponseV3_Result_Value_OneofUnmarshaler, _SearchResponseV3_Result_Value_OneofSizer, []interface{}{ 208 (*SearchResponseV3_Result_Value_Str)(nil), 209 (*SearchResponseV3_Result_Value_Int)(nil), 210 (*SearchResponseV3_Result_Value_Real)(nil), 211 } 212 } 213 214 func _SearchResponseV3_Result_Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 215 m := msg.(*SearchResponseV3_Result_Value) 216 // val 217 switch x := m.Val.(type) { 218 case *SearchResponseV3_Result_Value_Str: 219 b.EncodeVarint(1<<3 | proto.WireBytes) 220 b.EncodeStringBytes(x.Str) 221 case *SearchResponseV3_Result_Value_Int: 222 b.EncodeVarint(2<<3 | proto.WireVarint) 223 b.EncodeVarint(uint64(x.Int)) 224 case *SearchResponseV3_Result_Value_Real: 225 b.EncodeVarint(3<<3 | proto.WireFixed64) 226 b.EncodeFixed64(math.Float64bits(x.Real)) 227 case nil: 228 default: 229 return fmt.Errorf("SearchResponseV3_Result_Value.Val has unexpected type %T", x) 230 } 231 return nil 232 } 233 234 func _SearchResponseV3_Result_Value_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 235 m := msg.(*SearchResponseV3_Result_Value) 236 switch tag { 237 case 1: // val.str 238 if wire != proto.WireBytes { 239 return true, proto.ErrInternalBadWireType 240 } 241 x, err := b.DecodeStringBytes() 242 m.Val = &SearchResponseV3_Result_Value_Str{x} 243 return true, err 244 case 2: // val.int 245 if wire != proto.WireVarint { 246 return true, proto.ErrInternalBadWireType 247 } 248 x, err := b.DecodeVarint() 249 m.Val = &SearchResponseV3_Result_Value_Int{int64(x)} 250 return true, err 251 case 3: // val.real 252 if wire != proto.WireFixed64 { 253 return true, proto.ErrInternalBadWireType 254 } 255 x, err := b.DecodeFixed64() 256 m.Val = &SearchResponseV3_Result_Value_Real{math.Float64frombits(x)} 257 return true, err 258 default: 259 return false, nil 260 } 261 } 262 263 func _SearchResponseV3_Result_Value_OneofSizer(msg proto.Message) (n int) { 264 m := msg.(*SearchResponseV3_Result_Value) 265 // val 266 switch x := m.Val.(type) { 267 case *SearchResponseV3_Result_Value_Str: 268 n += proto.SizeVarint(1<<3 | proto.WireBytes) 269 n += proto.SizeVarint(uint64(len(x.Str))) 270 n += len(x.Str) 271 case *SearchResponseV3_Result_Value_Int: 272 n += proto.SizeVarint(2<<3 | proto.WireVarint) 273 n += proto.SizeVarint(uint64(x.Int)) 274 case *SearchResponseV3_Result_Value_Real: 275 n += proto.SizeVarint(3<<3 | proto.WireFixed64) 276 n += 8 277 case nil: 278 default: 279 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 280 } 281 return n 282 } 283 284 type SearchRequestV3 struct { 285 Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"` 286 } 287 288 func (m *SearchRequestV3) Reset() { *m = SearchRequestV3{} } 289 func (m *SearchRequestV3) String() string { return proto.CompactTextString(m) } 290 func (*SearchRequestV3) ProtoMessage() {} 291 func (*SearchRequestV3) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } 292 293 func (m *SearchRequestV3) GetQuery() string { 294 if m != nil { 295 return m.Query 296 } 297 return "" 298 } 299 300 func init() { 301 proto.RegisterType((*SearchResponseV3)(nil), "grpc.testingv3.SearchResponseV3") 302 proto.RegisterType((*SearchResponseV3_Result)(nil), "grpc.testingv3.SearchResponseV3.Result") 303 proto.RegisterType((*SearchResponseV3_Result_Value)(nil), "grpc.testingv3.SearchResponseV3.Result.Value") 304 proto.RegisterType((*SearchRequestV3)(nil), "grpc.testingv3.SearchRequestV3") 305 proto.RegisterEnum("grpc.testingv3.SearchResponseV3_State", SearchResponseV3_State_name, SearchResponseV3_State_value) 306 } 307 308 // Reference imports to suppress errors if they are not otherwise used. 309 var _ context.Context 310 var _ grpc.ClientConn 311 312 // This is a compile-time assertion to ensure that this generated file 313 // is compatible with the grpc package it is being compiled against. 314 const _ = grpc.SupportPackageIsVersion3 315 316 // Client API for SearchServiceV3 service 317 318 type SearchServiceV3Client interface { 319 Search(ctx context.Context, in *SearchRequestV3, opts ...grpc.CallOption) (*SearchResponseV3, error) 320 StreamingSearch(ctx context.Context, opts ...grpc.CallOption) (SearchServiceV3_StreamingSearchClient, error) 321 } 322 323 type searchServiceV3Client struct { 324 cc *grpc.ClientConn 325 } 326 327 func NewSearchServiceV3Client(cc *grpc.ClientConn) SearchServiceV3Client { 328 return &searchServiceV3Client{cc} 329 } 330 331 func (c *searchServiceV3Client) Search(ctx context.Context, in *SearchRequestV3, opts ...grpc.CallOption) (*SearchResponseV3, error) { 332 out := new(SearchResponseV3) 333 err := grpc.Invoke(ctx, "/grpc.testingv3.SearchServiceV3/Search", in, out, c.cc, opts...) 334 if err != nil { 335 return nil, err 336 } 337 return out, nil 338 } 339 340 func (c *searchServiceV3Client) StreamingSearch(ctx context.Context, opts ...grpc.CallOption) (SearchServiceV3_StreamingSearchClient, error) { 341 stream, err := grpc.NewClientStream(ctx, &_SearchServiceV3_serviceDesc.Streams[0], c.cc, "/grpc.testingv3.SearchServiceV3/StreamingSearch", opts...) 342 if err != nil { 343 return nil, err 344 } 345 x := &searchServiceV3StreamingSearchClient{stream} 346 return x, nil 347 } 348 349 type SearchServiceV3_StreamingSearchClient interface { 350 Send(*SearchRequestV3) error 351 Recv() (*SearchResponseV3, error) 352 grpc.ClientStream 353 } 354 355 type searchServiceV3StreamingSearchClient struct { 356 grpc.ClientStream 357 } 358 359 func (x *searchServiceV3StreamingSearchClient) Send(m *SearchRequestV3) error { 360 return x.ClientStream.SendMsg(m) 361 } 362 363 func (x *searchServiceV3StreamingSearchClient) Recv() (*SearchResponseV3, error) { 364 m := new(SearchResponseV3) 365 if err := x.ClientStream.RecvMsg(m); err != nil { 366 return nil, err 367 } 368 return m, nil 369 } 370 371 // Server API for SearchServiceV3 service 372 373 type SearchServiceV3Server interface { 374 Search(context.Context, *SearchRequestV3) (*SearchResponseV3, error) 375 StreamingSearch(SearchServiceV3_StreamingSearchServer) error 376 } 377 378 func RegisterSearchServiceV3Server(s *grpc.Server, srv SearchServiceV3Server) { 379 s.RegisterService(&_SearchServiceV3_serviceDesc, srv) 380 } 381 382 func _SearchServiceV3_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 383 in := new(SearchRequestV3) 384 if err := dec(in); err != nil { 385 return nil, err 386 } 387 if interceptor == nil { 388 return srv.(SearchServiceV3Server).Search(ctx, in) 389 } 390 info := &grpc.UnaryServerInfo{ 391 Server: srv, 392 FullMethod: "/grpc.testingv3.SearchServiceV3/Search", 393 } 394 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 395 return srv.(SearchServiceV3Server).Search(ctx, req.(*SearchRequestV3)) 396 } 397 return interceptor(ctx, in, info, handler) 398 } 399 400 func _SearchServiceV3_StreamingSearch_Handler(srv interface{}, stream grpc.ServerStream) error { 401 return srv.(SearchServiceV3Server).StreamingSearch(&searchServiceV3StreamingSearchServer{stream}) 402 } 403 404 type SearchServiceV3_StreamingSearchServer interface { 405 Send(*SearchResponseV3) error 406 Recv() (*SearchRequestV3, error) 407 grpc.ServerStream 408 } 409 410 type searchServiceV3StreamingSearchServer struct { 411 grpc.ServerStream 412 } 413 414 func (x *searchServiceV3StreamingSearchServer) Send(m *SearchResponseV3) error { 415 return x.ServerStream.SendMsg(m) 416 } 417 418 func (x *searchServiceV3StreamingSearchServer) Recv() (*SearchRequestV3, error) { 419 m := new(SearchRequestV3) 420 if err := x.ServerStream.RecvMsg(m); err != nil { 421 return nil, err 422 } 423 return m, nil 424 } 425 426 var _SearchServiceV3_serviceDesc = grpc.ServiceDesc{ 427 ServiceName: "grpc.testingv3.SearchServiceV3", 428 HandlerType: (*SearchServiceV3Server)(nil), 429 Methods: []grpc.MethodDesc{ 430 { 431 MethodName: "Search", 432 Handler: _SearchServiceV3_Search_Handler, 433 }, 434 }, 435 Streams: []grpc.StreamDesc{ 436 { 437 StreamName: "StreamingSearch", 438 Handler: _SearchServiceV3_StreamingSearch_Handler, 439 ServerStreams: true, 440 ClientStreams: true, 441 }, 442 }, 443 Metadata: fileDescriptor0, 444 } 445 446 func init() { proto.RegisterFile("testv3.proto", fileDescriptor0) } 447 448 var fileDescriptor0 = []byte{ 449 // 416 bytes of a gzipped FileDescriptorProto 450 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x93, 0xd1, 0x6a, 0xd4, 0x40, 451 0x14, 0x86, 0x77, 0x36, 0x9b, 0x6d, 0xf7, 0xac, 0xb6, 0x61, 0xe8, 0x45, 0xc8, 0x8d, 0x61, 0x2f, 452 0x6c, 0x10, 0x0c, 0x92, 0x20, 0x88, 0x78, 0x53, 0x65, 0x65, 0xa1, 0x75, 0xc5, 0x89, 0xae, 0xde, 453 0x8e, 0xeb, 0x61, 0x8d, 0x4d, 0xb3, 0xe9, 0xcc, 0x49, 0x60, 0x9f, 0xc5, 0x17, 0xf1, 0x55, 0x7c, 454 0x1b, 0x99, 0x99, 0xa6, 0x50, 0x41, 0xba, 0x17, 0xde, 0xcd, 0x7f, 0x38, 0xff, 0x37, 0xff, 0x3f, 455 0x24, 0xf0, 0x80, 0x50, 0x53, 0x97, 0xa7, 0x8d, 0xda, 0xd2, 0x96, 0x1f, 0x6d, 0x54, 0xb3, 0x4e, 456 0xcd, 0xa8, 0xac, 0x37, 0x5d, 0x3e, 0xfb, 0x39, 0x82, 0xa0, 0x40, 0xa9, 0xd6, 0xdf, 0x05, 0xea, 457 0x66, 0x5b, 0x6b, 0x5c, 0xe5, 0xfc, 0x0c, 0x0e, 0x14, 0xea, 0xb6, 0x22, 0x1d, 0xb2, 0xd8, 0x4b, 458 0xa6, 0xd9, 0x69, 0x7a, 0xd7, 0x96, 0xfe, 0x6d, 0x49, 0x85, 0xdd, 0x17, 0xbd, 0x8f, 0xbf, 0x02, 459 0x5f, 0x93, 0x24, 0x0c, 0x87, 0x31, 0x4b, 0x8e, 0xb2, 0xc7, 0xf7, 0x02, 0x0a, 0xb3, 0x2d, 0x9c, 460 0x29, 0xfa, 0x3d, 0x84, 0xb1, 0x23, 0xf2, 0x00, 0xbc, 0x56, 0x55, 0x21, 0x8b, 0x59, 0x32, 0x11, 461 0xe6, 0xc8, 0x4f, 0xc0, 0xa7, 0x92, 0x2a, 0x87, 0x9e, 0x08, 0x27, 0x78, 0x04, 0x87, 0xba, 0x2e, 462 0x9b, 0x06, 0x49, 0x87, 0x5e, 0xec, 0x25, 0x13, 0x71, 0xab, 0xf9, 0x07, 0x38, 0xbc, 0x42, 0x92, 463 0xdf, 0x24, 0xc9, 0x70, 0x64, 0x0b, 0x3d, 0xdf, 0xb3, 0x50, 0xfa, 0xee, 0xc6, 0x37, 0xaf, 0x49, 464 0xed, 0xc4, 0x2d, 0x26, 0xba, 0x00, 0x7f, 0x25, 0xab, 0x16, 0x39, 0x07, 0x4f, 0x93, 0x72, 0xf9, 465 0x16, 0x03, 0x61, 0x84, 0x99, 0x95, 0x35, 0xd9, 0x7c, 0x9e, 0x99, 0x95, 0x35, 0xf1, 0x13, 0x18, 466 0x29, 0x94, 0x55, 0xe8, 0xc5, 0x2c, 0x61, 0x8b, 0x81, 0xb0, 0xea, 0xb5, 0x0f, 0x5e, 0x27, 0xab, 467 0xe8, 0x07, 0x3c, 0xbc, 0x73, 0x91, 0x69, 0x7d, 0x89, 0xbb, 0xbe, 0xf5, 0x25, 0xee, 0xf8, 0x1b, 468 0xf0, 0x3b, 0x73, 0xa1, 0xa5, 0x4e, 0xb3, 0xa7, 0xfb, 0x16, 0xb0, 0x29, 0x85, 0xf3, 0xbe, 0x1c, 469 0xbe, 0x60, 0xb3, 0x27, 0xe0, 0xdb, 0xb7, 0xe6, 0x53, 0x38, 0xf8, 0xb4, 0x3c, 0x5f, 0xbe, 0xff, 470 0xbc, 0x0c, 0x06, 0x7c, 0x02, 0xfe, 0x5b, 0x31, 0x2f, 0x16, 0x01, 0x33, 0xc7, 0xe2, 0xe3, 0xd9, 471 0xc5, 0x3c, 0x18, 0xce, 0x4e, 0xe1, 0xb8, 0xe7, 0x5e, 0xb7, 0xa8, 0x69, 0x95, 0x9b, 0xd7, 0xbf, 472 0x6e, 0x51, 0xf5, 0xd9, 0x9c, 0xc8, 0x7e, 0xb1, 0x7e, 0xb3, 0x40, 0xd5, 0x95, 0x6b, 0xf3, 0x15, 473 0x9d, 0xc3, 0xd8, 0x8d, 0xf8, 0xa3, 0x7f, 0x85, 0xbd, 0x81, 0x46, 0xf1, 0x7d, 0x6d, 0xf8, 0x17, 474 0x38, 0x2e, 0x48, 0xa1, 0xbc, 0x2a, 0xeb, 0xcd, 0x7f, 0xa3, 0x26, 0xec, 0x19, 0xfb, 0x3a, 0xb6, 475 0x3f, 0x46, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, 0xed, 0xa2, 0x8d, 0x75, 0x28, 0x03, 0x00, 0x00, 476 }