You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

458 regels
16 KiB

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