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.
 
 
 

320 lines
11 KiB

  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // source: test.proto
  3. package grpc_testing
  4. import proto "github.com/golang/protobuf/proto"
  5. import fmt "fmt"
  6. import math "math"
  7. import (
  8. context "golang.org/x/net/context"
  9. grpc "google.golang.org/grpc"
  10. )
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  15. // This is a compile-time assertion to ensure that this generated file
  16. // is compatible with the proto package it is being compiled against.
  17. // A compilation error at this line likely means your copy of the
  18. // proto package needs to be updated.
  19. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  20. type SearchResponse struct {
  21. Results []*SearchResponse_Result `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
  22. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  23. XXX_unrecognized []byte `json:"-"`
  24. XXX_sizecache int32 `json:"-"`
  25. }
  26. func (m *SearchResponse) Reset() { *m = SearchResponse{} }
  27. func (m *SearchResponse) String() string { return proto.CompactTextString(m) }
  28. func (*SearchResponse) ProtoMessage() {}
  29. func (*SearchResponse) Descriptor() ([]byte, []int) {
  30. return fileDescriptor_test_a0c753075da50dd4, []int{0}
  31. }
  32. func (m *SearchResponse) XXX_Unmarshal(b []byte) error {
  33. return xxx_messageInfo_SearchResponse.Unmarshal(m, b)
  34. }
  35. func (m *SearchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  36. return xxx_messageInfo_SearchResponse.Marshal(b, m, deterministic)
  37. }
  38. func (dst *SearchResponse) XXX_Merge(src proto.Message) {
  39. xxx_messageInfo_SearchResponse.Merge(dst, src)
  40. }
  41. func (m *SearchResponse) XXX_Size() int {
  42. return xxx_messageInfo_SearchResponse.Size(m)
  43. }
  44. func (m *SearchResponse) XXX_DiscardUnknown() {
  45. xxx_messageInfo_SearchResponse.DiscardUnknown(m)
  46. }
  47. var xxx_messageInfo_SearchResponse proto.InternalMessageInfo
  48. func (m *SearchResponse) GetResults() []*SearchResponse_Result {
  49. if m != nil {
  50. return m.Results
  51. }
  52. return nil
  53. }
  54. type SearchResponse_Result struct {
  55. Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
  56. Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
  57. Snippets []string `protobuf:"bytes,3,rep,name=snippets,proto3" json:"snippets,omitempty"`
  58. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  59. XXX_unrecognized []byte `json:"-"`
  60. XXX_sizecache int32 `json:"-"`
  61. }
  62. func (m *SearchResponse_Result) Reset() { *m = SearchResponse_Result{} }
  63. func (m *SearchResponse_Result) String() string { return proto.CompactTextString(m) }
  64. func (*SearchResponse_Result) ProtoMessage() {}
  65. func (*SearchResponse_Result) Descriptor() ([]byte, []int) {
  66. return fileDescriptor_test_a0c753075da50dd4, []int{0, 0}
  67. }
  68. func (m *SearchResponse_Result) XXX_Unmarshal(b []byte) error {
  69. return xxx_messageInfo_SearchResponse_Result.Unmarshal(m, b)
  70. }
  71. func (m *SearchResponse_Result) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  72. return xxx_messageInfo_SearchResponse_Result.Marshal(b, m, deterministic)
  73. }
  74. func (dst *SearchResponse_Result) XXX_Merge(src proto.Message) {
  75. xxx_messageInfo_SearchResponse_Result.Merge(dst, src)
  76. }
  77. func (m *SearchResponse_Result) XXX_Size() int {
  78. return xxx_messageInfo_SearchResponse_Result.Size(m)
  79. }
  80. func (m *SearchResponse_Result) XXX_DiscardUnknown() {
  81. xxx_messageInfo_SearchResponse_Result.DiscardUnknown(m)
  82. }
  83. var xxx_messageInfo_SearchResponse_Result proto.InternalMessageInfo
  84. func (m *SearchResponse_Result) GetUrl() string {
  85. if m != nil {
  86. return m.Url
  87. }
  88. return ""
  89. }
  90. func (m *SearchResponse_Result) GetTitle() string {
  91. if m != nil {
  92. return m.Title
  93. }
  94. return ""
  95. }
  96. func (m *SearchResponse_Result) GetSnippets() []string {
  97. if m != nil {
  98. return m.Snippets
  99. }
  100. return nil
  101. }
  102. type SearchRequest struct {
  103. Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
  104. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  105. XXX_unrecognized []byte `json:"-"`
  106. XXX_sizecache int32 `json:"-"`
  107. }
  108. func (m *SearchRequest) Reset() { *m = SearchRequest{} }
  109. func (m *SearchRequest) String() string { return proto.CompactTextString(m) }
  110. func (*SearchRequest) ProtoMessage() {}
  111. func (*SearchRequest) Descriptor() ([]byte, []int) {
  112. return fileDescriptor_test_a0c753075da50dd4, []int{1}
  113. }
  114. func (m *SearchRequest) XXX_Unmarshal(b []byte) error {
  115. return xxx_messageInfo_SearchRequest.Unmarshal(m, b)
  116. }
  117. func (m *SearchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  118. return xxx_messageInfo_SearchRequest.Marshal(b, m, deterministic)
  119. }
  120. func (dst *SearchRequest) XXX_Merge(src proto.Message) {
  121. xxx_messageInfo_SearchRequest.Merge(dst, src)
  122. }
  123. func (m *SearchRequest) XXX_Size() int {
  124. return xxx_messageInfo_SearchRequest.Size(m)
  125. }
  126. func (m *SearchRequest) XXX_DiscardUnknown() {
  127. xxx_messageInfo_SearchRequest.DiscardUnknown(m)
  128. }
  129. var xxx_messageInfo_SearchRequest proto.InternalMessageInfo
  130. func (m *SearchRequest) GetQuery() string {
  131. if m != nil {
  132. return m.Query
  133. }
  134. return ""
  135. }
  136. func init() {
  137. proto.RegisterType((*SearchResponse)(nil), "grpc.testing.SearchResponse")
  138. proto.RegisterType((*SearchResponse_Result)(nil), "grpc.testing.SearchResponse.Result")
  139. proto.RegisterType((*SearchRequest)(nil), "grpc.testing.SearchRequest")
  140. }
  141. // Reference imports to suppress errors if they are not otherwise used.
  142. var _ context.Context
  143. var _ grpc.ClientConn
  144. // This is a compile-time assertion to ensure that this generated file
  145. // is compatible with the grpc package it is being compiled against.
  146. const _ = grpc.SupportPackageIsVersion4
  147. // SearchServiceClient is the client API for SearchService service.
  148. //
  149. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  150. type SearchServiceClient interface {
  151. Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
  152. StreamingSearch(ctx context.Context, opts ...grpc.CallOption) (SearchService_StreamingSearchClient, error)
  153. }
  154. type searchServiceClient struct {
  155. cc *grpc.ClientConn
  156. }
  157. func NewSearchServiceClient(cc *grpc.ClientConn) SearchServiceClient {
  158. return &searchServiceClient{cc}
  159. }
  160. func (c *searchServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) {
  161. out := new(SearchResponse)
  162. err := c.cc.Invoke(ctx, "/grpc.testing.SearchService/Search", in, out, opts...)
  163. if err != nil {
  164. return nil, err
  165. }
  166. return out, nil
  167. }
  168. func (c *searchServiceClient) StreamingSearch(ctx context.Context, opts ...grpc.CallOption) (SearchService_StreamingSearchClient, error) {
  169. stream, err := c.cc.NewStream(ctx, &_SearchService_serviceDesc.Streams[0], "/grpc.testing.SearchService/StreamingSearch", opts...)
  170. if err != nil {
  171. return nil, err
  172. }
  173. x := &searchServiceStreamingSearchClient{stream}
  174. return x, nil
  175. }
  176. type SearchService_StreamingSearchClient interface {
  177. Send(*SearchRequest) error
  178. Recv() (*SearchResponse, error)
  179. grpc.ClientStream
  180. }
  181. type searchServiceStreamingSearchClient struct {
  182. grpc.ClientStream
  183. }
  184. func (x *searchServiceStreamingSearchClient) Send(m *SearchRequest) error {
  185. return x.ClientStream.SendMsg(m)
  186. }
  187. func (x *searchServiceStreamingSearchClient) Recv() (*SearchResponse, error) {
  188. m := new(SearchResponse)
  189. if err := x.ClientStream.RecvMsg(m); err != nil {
  190. return nil, err
  191. }
  192. return m, nil
  193. }
  194. // SearchServiceServer is the server API for SearchService service.
  195. type SearchServiceServer interface {
  196. Search(context.Context, *SearchRequest) (*SearchResponse, error)
  197. StreamingSearch(SearchService_StreamingSearchServer) error
  198. }
  199. func RegisterSearchServiceServer(s *grpc.Server, srv SearchServiceServer) {
  200. s.RegisterService(&_SearchService_serviceDesc, srv)
  201. }
  202. func _SearchService_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  203. in := new(SearchRequest)
  204. if err := dec(in); err != nil {
  205. return nil, err
  206. }
  207. if interceptor == nil {
  208. return srv.(SearchServiceServer).Search(ctx, in)
  209. }
  210. info := &grpc.UnaryServerInfo{
  211. Server: srv,
  212. FullMethod: "/grpc.testing.SearchService/Search",
  213. }
  214. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  215. return srv.(SearchServiceServer).Search(ctx, req.(*SearchRequest))
  216. }
  217. return interceptor(ctx, in, info, handler)
  218. }
  219. func _SearchService_StreamingSearch_Handler(srv interface{}, stream grpc.ServerStream) error {
  220. return srv.(SearchServiceServer).StreamingSearch(&searchServiceStreamingSearchServer{stream})
  221. }
  222. type SearchService_StreamingSearchServer interface {
  223. Send(*SearchResponse) error
  224. Recv() (*SearchRequest, error)
  225. grpc.ServerStream
  226. }
  227. type searchServiceStreamingSearchServer struct {
  228. grpc.ServerStream
  229. }
  230. func (x *searchServiceStreamingSearchServer) Send(m *SearchResponse) error {
  231. return x.ServerStream.SendMsg(m)
  232. }
  233. func (x *searchServiceStreamingSearchServer) Recv() (*SearchRequest, error) {
  234. m := new(SearchRequest)
  235. if err := x.ServerStream.RecvMsg(m); err != nil {
  236. return nil, err
  237. }
  238. return m, nil
  239. }
  240. var _SearchService_serviceDesc = grpc.ServiceDesc{
  241. ServiceName: "grpc.testing.SearchService",
  242. HandlerType: (*SearchServiceServer)(nil),
  243. Methods: []grpc.MethodDesc{
  244. {
  245. MethodName: "Search",
  246. Handler: _SearchService_Search_Handler,
  247. },
  248. },
  249. Streams: []grpc.StreamDesc{
  250. {
  251. StreamName: "StreamingSearch",
  252. Handler: _SearchService_StreamingSearch_Handler,
  253. ServerStreams: true,
  254. ClientStreams: true,
  255. },
  256. },
  257. Metadata: "test.proto",
  258. }
  259. func init() { proto.RegisterFile("test.proto", fileDescriptor_test_a0c753075da50dd4) }
  260. var fileDescriptor_test_a0c753075da50dd4 = []byte{
  261. // 231 bytes of a gzipped FileDescriptorProto
  262. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x91, 0xbd, 0x4a, 0xc5, 0x40,
  263. 0x10, 0x85, 0x59, 0x83, 0xd1, 0x3b, 0xfe, 0x32, 0x58, 0x84, 0x68, 0x11, 0xae, 0x08, 0xa9, 0x16,
  264. 0xb9, 0xd6, 0x56, 0xb6, 0x16, 0xb2, 0x79, 0x82, 0x6b, 0x18, 0xe2, 0x42, 0x4c, 0x36, 0x33, 0x13,
  265. 0xc1, 0x87, 0xb1, 0xf5, 0x39, 0x25, 0x59, 0x23, 0x0a, 0x62, 0x63, 0xb7, 0xe7, 0xe3, 0xcc, 0xb7,
  266. 0xbb, 0x0c, 0x80, 0x92, 0xa8, 0x0d, 0xdc, 0x6b, 0x8f, 0x87, 0x0d, 0x87, 0xda, 0x4e, 0xc0, 0x77,
  267. 0xcd, 0xfa, 0xcd, 0xc0, 0x71, 0x45, 0x5b, 0xae, 0x9f, 0x1c, 0x49, 0xe8, 0x3b, 0x21, 0xbc, 0x85,
  268. 0x3d, 0x26, 0x19, 0x5b, 0x95, 0xcc, 0x14, 0x49, 0x79, 0xb0, 0xb9, 0xb4, 0xdf, 0x47, 0xec, 0xcf,
  269. 0xba, 0x75, 0x73, 0xd7, 0x2d, 0x33, 0xf9, 0x3d, 0xa4, 0x11, 0xe1, 0x29, 0x24, 0x23, 0xb7, 0x99,
  270. 0x29, 0x4c, 0xb9, 0x72, 0xd3, 0x11, 0xcf, 0x60, 0x57, 0xbd, 0xb6, 0x94, 0xed, 0xcc, 0x2c, 0x06,
  271. 0xcc, 0x61, 0x5f, 0x3a, 0x1f, 0x02, 0xa9, 0x64, 0x49, 0x91, 0x94, 0x2b, 0xf7, 0x95, 0xd7, 0x57,
  272. 0x70, 0xb4, 0xdc, 0x37, 0x8c, 0x24, 0x3a, 0x29, 0x86, 0x91, 0xf8, 0xf5, 0x53, 0x1b, 0xc3, 0xe6,
  273. 0xdd, 0x2c, 0xbd, 0x8a, 0xf8, 0xc5, 0xd7, 0x84, 0x77, 0x90, 0x46, 0x80, 0xe7, 0xbf, 0x3f, 0x7f,
  274. 0xd6, 0xe5, 0x17, 0x7f, 0xfd, 0x0d, 0x1f, 0xe0, 0xa4, 0x52, 0xa6, 0xed, 0xb3, 0xef, 0x9a, 0x7f,
  275. 0xdb, 0x4a, 0x73, 0x6d, 0x1e, 0xd3, 0x79, 0x09, 0x37, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x20,
  276. 0xd6, 0x09, 0xb8, 0x92, 0x01, 0x00, 0x00,
  277. }