github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/talks/2015/gotham-grpc/search-only/search-only.pb.go (about) 1 // Code generated by protoc-gen-go. 2 // source: search-only.proto 3 // DO NOT EDIT! 4 5 /* 6 Package search_only is a generated protocol buffer package. 7 8 It is generated from these files: 9 search-only.proto 10 11 It has these top-level messages: 12 Request 13 Result 14 */ 15 package search_only 16 17 import proto "github.com/golang/protobuf/proto" 18 import fmt "fmt" 19 import math "math" 20 21 import ( 22 context "golang.org/x/net/context" 23 grpc "google.golang.org/grpc" 24 ) 25 26 // Reference imports to suppress errors if they are not otherwise used. 27 var _ = proto.Marshal 28 var _ = fmt.Errorf 29 var _ = math.Inf 30 31 type Request struct { 32 Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"` 33 } 34 35 func (m *Request) Reset() { *m = Request{} } 36 func (m *Request) String() string { return proto.CompactTextString(m) } 37 func (*Request) ProtoMessage() {} 38 39 type Result struct { 40 Title string `protobuf:"bytes,1,opt,name=title" json:"title,omitempty"` 41 Url string `protobuf:"bytes,2,opt,name=url" json:"url,omitempty"` 42 Snippet string `protobuf:"bytes,3,opt,name=snippet" json:"snippet,omitempty"` 43 } 44 45 func (m *Result) Reset() { *m = Result{} } 46 func (m *Result) String() string { return proto.CompactTextString(m) } 47 func (*Result) ProtoMessage() {} 48 49 // Reference imports to suppress errors if they are not otherwise used. 50 var _ context.Context 51 var _ grpc.ClientConn 52 53 // Client API for Google service 54 55 type GoogleClient interface { 56 // Search returns a Google search result for the query. 57 Search(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error) 58 } 59 60 type googleClient struct { 61 cc *grpc.ClientConn 62 } 63 64 func NewGoogleClient(cc *grpc.ClientConn) GoogleClient { 65 return &googleClient{cc} 66 } 67 68 func (c *googleClient) Search(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Result, error) { 69 out := new(Result) 70 err := grpc.Invoke(ctx, "/.Google/Search", in, out, c.cc, opts...) 71 if err != nil { 72 return nil, err 73 } 74 return out, nil 75 } 76 77 // Server API for Google service 78 79 type GoogleServer interface { 80 // Search returns a Google search result for the query. 81 Search(context.Context, *Request) (*Result, error) 82 } 83 84 func RegisterGoogleServer(s *grpc.Server, srv GoogleServer) { 85 s.RegisterService(&_Google_serviceDesc, srv) 86 } 87 88 func _Google_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) { 89 in := new(Request) 90 if err := dec(in); err != nil { 91 return nil, err 92 } 93 out, err := srv.(GoogleServer).Search(ctx, in) 94 if err != nil { 95 return nil, err 96 } 97 return out, nil 98 } 99 100 var _Google_serviceDesc = grpc.ServiceDesc{ 101 ServiceName: ".Google", 102 HandlerType: (*GoogleServer)(nil), 103 Methods: []grpc.MethodDesc{ 104 { 105 MethodName: "Search", 106 Handler: _Google_Search_Handler, 107 }, 108 }, 109 Streams: []grpc.StreamDesc{}, 110 }