test.pb.go 12 KB

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