1 // Code generated by protoc-gen-go. DO NOT EDIT.
6 import proto "github.com/golang/protobuf/proto"
11 context "golang.org/x/net/context"
12 grpc "google.golang.org/grpc"
15 // Reference imports to suppress errors if they are not otherwise used.
20 type SearchResponse struct {
21 Results []*SearchResponse_Result `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"`
24 func (m *SearchResponse) Reset() { *m = SearchResponse{} }
25 func (m *SearchResponse) String() string { return proto.CompactTextString(m) }
26 func (*SearchResponse) ProtoMessage() {}
27 func (*SearchResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
29 func (m *SearchResponse) GetResults() []*SearchResponse_Result {
36 type SearchResponse_Result struct {
37 Url string `protobuf:"bytes,1,opt,name=url" json:"url,omitempty"`
38 Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"`
39 Snippets []string `protobuf:"bytes,3,rep,name=snippets" json:"snippets,omitempty"`
42 func (m *SearchResponse_Result) Reset() { *m = SearchResponse_Result{} }
43 func (m *SearchResponse_Result) String() string { return proto.CompactTextString(m) }
44 func (*SearchResponse_Result) ProtoMessage() {}
45 func (*SearchResponse_Result) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} }
47 func (m *SearchResponse_Result) GetUrl() string {
54 func (m *SearchResponse_Result) GetTitle() string {
61 func (m *SearchResponse_Result) GetSnippets() []string {
68 type SearchRequest struct {
69 Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"`
72 func (m *SearchRequest) Reset() { *m = SearchRequest{} }
73 func (m *SearchRequest) String() string { return proto.CompactTextString(m) }
74 func (*SearchRequest) ProtoMessage() {}
75 func (*SearchRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} }
77 func (m *SearchRequest) GetQuery() string {
85 proto.RegisterType((*SearchResponse)(nil), "grpc.testing.SearchResponse")
86 proto.RegisterType((*SearchResponse_Result)(nil), "grpc.testing.SearchResponse.Result")
87 proto.RegisterType((*SearchRequest)(nil), "grpc.testing.SearchRequest")
90 // Reference imports to suppress errors if they are not otherwise used.
94 // This is a compile-time assertion to ensure that this generated file
95 // is compatible with the grpc package it is being compiled against.
96 const _ = grpc.SupportPackageIsVersion4
98 // Client API for SearchService service
100 type SearchServiceClient interface {
101 Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error)
102 StreamingSearch(ctx context.Context, opts ...grpc.CallOption) (SearchService_StreamingSearchClient, error)
105 type searchServiceClient struct {
109 func NewSearchServiceClient(cc *grpc.ClientConn) SearchServiceClient {
110 return &searchServiceClient{cc}
113 func (c *searchServiceClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) {
114 out := new(SearchResponse)
115 err := grpc.Invoke(ctx, "/grpc.testing.SearchService/Search", in, out, c.cc, opts...)
122 func (c *searchServiceClient) StreamingSearch(ctx context.Context, opts ...grpc.CallOption) (SearchService_StreamingSearchClient, error) {
123 stream, err := grpc.NewClientStream(ctx, &_SearchService_serviceDesc.Streams[0], c.cc, "/grpc.testing.SearchService/StreamingSearch", opts...)
127 x := &searchServiceStreamingSearchClient{stream}
131 type SearchService_StreamingSearchClient interface {
132 Send(*SearchRequest) error
133 Recv() (*SearchResponse, error)
137 type searchServiceStreamingSearchClient struct {
141 func (x *searchServiceStreamingSearchClient) Send(m *SearchRequest) error {
142 return x.ClientStream.SendMsg(m)
145 func (x *searchServiceStreamingSearchClient) Recv() (*SearchResponse, error) {
146 m := new(SearchResponse)
147 if err := x.ClientStream.RecvMsg(m); err != nil {
153 // Server API for SearchService service
155 type SearchServiceServer interface {
156 Search(context.Context, *SearchRequest) (*SearchResponse, error)
157 StreamingSearch(SearchService_StreamingSearchServer) error
160 func RegisterSearchServiceServer(s *grpc.Server, srv SearchServiceServer) {
161 s.RegisterService(&_SearchService_serviceDesc, srv)
164 func _SearchService_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
165 in := new(SearchRequest)
166 if err := dec(in); err != nil {
169 if interceptor == nil {
170 return srv.(SearchServiceServer).Search(ctx, in)
172 info := &grpc.UnaryServerInfo{
174 FullMethod: "/grpc.testing.SearchService/Search",
176 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
177 return srv.(SearchServiceServer).Search(ctx, req.(*SearchRequest))
179 return interceptor(ctx, in, info, handler)
182 func _SearchService_StreamingSearch_Handler(srv interface{}, stream grpc.ServerStream) error {
183 return srv.(SearchServiceServer).StreamingSearch(&searchServiceStreamingSearchServer{stream})
186 type SearchService_StreamingSearchServer interface {
187 Send(*SearchResponse) error
188 Recv() (*SearchRequest, error)
192 type searchServiceStreamingSearchServer struct {
196 func (x *searchServiceStreamingSearchServer) Send(m *SearchResponse) error {
197 return x.ServerStream.SendMsg(m)
200 func (x *searchServiceStreamingSearchServer) Recv() (*SearchRequest, error) {
201 m := new(SearchRequest)
202 if err := x.ServerStream.RecvMsg(m); err != nil {
208 var _SearchService_serviceDesc = grpc.ServiceDesc{
209 ServiceName: "grpc.testing.SearchService",
210 HandlerType: (*SearchServiceServer)(nil),
211 Methods: []grpc.MethodDesc{
213 MethodName: "Search",
214 Handler: _SearchService_Search_Handler,
217 Streams: []grpc.StreamDesc{
219 StreamName: "StreamingSearch",
220 Handler: _SearchService_StreamingSearch_Handler,
225 Metadata: "test.proto",
228 func init() { proto.RegisterFile("test.proto", fileDescriptor3) }
230 var fileDescriptor3 = []byte{
231 // 231 bytes of a gzipped FileDescriptorProto
232 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x91, 0xbd, 0x4a, 0xc5, 0x40,
233 0x10, 0x85, 0x59, 0x83, 0xd1, 0x3b, 0xfe, 0x32, 0x58, 0x84, 0x68, 0x11, 0xae, 0x08, 0xa9, 0x16,
234 0xb9, 0xd6, 0x56, 0xb6, 0x16, 0xb2, 0x79, 0x82, 0x6b, 0x18, 0xe2, 0x42, 0x4c, 0x36, 0x33, 0x13,
235 0xc1, 0x87, 0xb1, 0xf5, 0x39, 0x25, 0x59, 0x23, 0x0a, 0x62, 0x63, 0xb7, 0xe7, 0xe3, 0xcc, 0xb7,
236 0xbb, 0x0c, 0x80, 0x92, 0xa8, 0x0d, 0xdc, 0x6b, 0x8f, 0x87, 0x0d, 0x87, 0xda, 0x4e, 0xc0, 0x77,
237 0xcd, 0xfa, 0xcd, 0xc0, 0x71, 0x45, 0x5b, 0xae, 0x9f, 0x1c, 0x49, 0xe8, 0x3b, 0x21, 0xbc, 0x85,
238 0x3d, 0x26, 0x19, 0x5b, 0x95, 0xcc, 0x14, 0x49, 0x79, 0xb0, 0xb9, 0xb4, 0xdf, 0x47, 0xec, 0xcf,
239 0xba, 0x75, 0x73, 0xd7, 0x2d, 0x33, 0xf9, 0x3d, 0xa4, 0x11, 0xe1, 0x29, 0x24, 0x23, 0xb7, 0x99,
240 0x29, 0x4c, 0xb9, 0x72, 0xd3, 0x11, 0xcf, 0x60, 0x57, 0xbd, 0xb6, 0x94, 0xed, 0xcc, 0x2c, 0x06,
241 0xcc, 0x61, 0x5f, 0x3a, 0x1f, 0x02, 0xa9, 0x64, 0x49, 0x91, 0x94, 0x2b, 0xf7, 0x95, 0xd7, 0x57,
242 0x70, 0xb4, 0xdc, 0x37, 0x8c, 0x24, 0x3a, 0x29, 0x86, 0x91, 0xf8, 0xf5, 0x53, 0x1b, 0xc3, 0xe6,
243 0xdd, 0x2c, 0xbd, 0x8a, 0xf8, 0xc5, 0xd7, 0x84, 0x77, 0x90, 0x46, 0x80, 0xe7, 0xbf, 0x3f, 0x7f,
244 0xd6, 0xe5, 0x17, 0x7f, 0xfd, 0x0d, 0x1f, 0xe0, 0xa4, 0x52, 0xa6, 0xed, 0xb3, 0xef, 0x9a, 0x7f,
245 0xdb, 0x4a, 0x73, 0x6d, 0x1e, 0xd3, 0x79, 0x09, 0x37, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x20,
246 0xd6, 0x09, 0xb8, 0x92, 0x01, 0x00, 0x00,