Code

Add an initial version of sample code for my Go talk.
[go-talk.git] / grpc / proto / backend / backend.pb.go
1 // Code generated by protoc-gen-go.
2 // source: src/tokkee.org/go-talk/grpc/proto/backend/backend.proto
3 // DO NOT EDIT!
5 /*
6 Package backend is a generated protocol buffer package.
8 It is generated from these files:
9         src/tokkee.org/go-talk/grpc/proto/backend/backend.proto
11 It has these top-level messages:
12         QueryRequest
13         QueryReply
14 */
15 package backend
17 import proto "github.com/golang/protobuf/proto"
18 import fmt "fmt"
19 import math "math"
21 import (
22         context "golang.org/x/net/context"
23         grpc "google.golang.org/grpc"
24 )
26 // Reference imports to suppress errors if they are not otherwise used.
27 var _ = proto.Marshal
28 var _ = fmt.Errorf
29 var _ = math.Inf
31 // This is a compile-time assertion to ensure that this generated file
32 // is compatible with the proto package it is being compiled against.
33 const _ = proto.ProtoPackageIsVersion1
35 type QueryRequest struct {
36         Query string `protobuf:"bytes,1,opt,name=query" json:"query,omitempty"`
37 }
39 func (m *QueryRequest) Reset()                    { *m = QueryRequest{} }
40 func (m *QueryRequest) String() string            { return proto.CompactTextString(m) }
41 func (*QueryRequest) ProtoMessage()               {}
42 func (*QueryRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
44 type QueryReply struct {
45         Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
46         N    int64  `protobuf:"varint,2,opt,name=n" json:"n,omitempty"`
47 }
49 func (m *QueryReply) Reset()                    { *m = QueryReply{} }
50 func (m *QueryReply) String() string            { return proto.CompactTextString(m) }
51 func (*QueryReply) ProtoMessage()               {}
52 func (*QueryReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
54 func init() {
55         proto.RegisterType((*QueryRequest)(nil), "backend.QueryRequest")
56         proto.RegisterType((*QueryReply)(nil), "backend.QueryReply")
57 }
59 // Reference imports to suppress errors if they are not otherwise used.
60 var _ context.Context
61 var _ grpc.ClientConn
63 // This is a compile-time assertion to ensure that this generated file
64 // is compatible with the grpc package it is being compiled against.
65 const _ = grpc.SupportPackageIsVersion2
67 // Client API for Backend service
69 type BackendClient interface {
70         Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryReply, error)
71 }
73 type backendClient struct {
74         cc *grpc.ClientConn
75 }
77 func NewBackendClient(cc *grpc.ClientConn) BackendClient {
78         return &backendClient{cc}
79 }
81 func (c *backendClient) Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryReply, error) {
82         out := new(QueryReply)
83         err := grpc.Invoke(ctx, "/backend.Backend/Query", in, out, c.cc, opts...)
84         if err != nil {
85                 return nil, err
86         }
87         return out, nil
88 }
90 // Server API for Backend service
92 type BackendServer interface {
93         Query(context.Context, *QueryRequest) (*QueryReply, error)
94 }
96 func RegisterBackendServer(s *grpc.Server, srv BackendServer) {
97         s.RegisterService(&_Backend_serviceDesc, srv)
98 }
100 func _Backend_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
101         in := new(QueryRequest)
102         if err := dec(in); err != nil {
103                 return nil, err
104         }
105         if interceptor == nil {
106                 return srv.(BackendServer).Query(ctx, in)
107         }
108         info := &grpc.UnaryServerInfo{
109                 Server:     srv,
110                 FullMethod: "/backend.Backend/Query",
111         }
112         handler := func(ctx context.Context, req interface{}) (interface{}, error) {
113                 return srv.(BackendServer).Query(ctx, req.(*QueryRequest))
114         }
115         return interceptor(ctx, in, info, handler)
118 var _Backend_serviceDesc = grpc.ServiceDesc{
119         ServiceName: "backend.Backend",
120         HandlerType: (*BackendServer)(nil),
121         Methods: []grpc.MethodDesc{
122                 {
123                         MethodName: "Query",
124                         Handler:    _Backend_Query_Handler,
125                 },
126         },
127         Streams: []grpc.StreamDesc{},
130 var fileDescriptor0 = []byte{
131         // 174 bytes of a gzipped FileDescriptorProto
132         0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x32, 0x2f, 0x2e, 0x4a, 0xd6,
133         0x2f, 0xc9, 0xcf, 0xce, 0x4e, 0x4d, 0xd5, 0xcb, 0x2f, 0x4a, 0xd7, 0x4f, 0xcf, 0xd7, 0x2d, 0x49,
134         0xcc, 0xc9, 0xd6, 0x4f, 0x2f, 0x2a, 0x48, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x4f, 0x4a,
135         0x4c, 0xce, 0x4e, 0xcd, 0x4b, 0x81, 0xd1, 0x7a, 0x60, 0x51, 0x21, 0x76, 0x28, 0x57, 0x49, 0x85,
136         0x8b, 0x27, 0xb0, 0x34, 0xb5, 0xa8, 0x32, 0x28, 0xb5, 0xb0, 0x34, 0xb5, 0xb8, 0x44, 0x48, 0x84,
137         0x8b, 0xb5, 0x10, 0xc4, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0x70, 0x94, 0xf4, 0xb8,
138         0xb8, 0xa0, 0xaa, 0x0a, 0x72, 0x2a, 0x85, 0x84, 0xb8, 0x58, 0x4a, 0x2a, 0x0b, 0x52, 0xa1, 0x4a,
139         0xc0, 0x6c, 0x21, 0x1e, 0x2e, 0xc6, 0x3c, 0x09, 0x26, 0xa0, 0x00, 0x73, 0x10, 0x63, 0x9e, 0x91,
140         0x03, 0x17, 0xbb, 0x13, 0xc4, 0x02, 0x21, 0x53, 0x2e, 0x56, 0xb0, 0x56, 0x21, 0x51, 0x3d, 0x98,
141         0x13, 0x90, 0x2d, 0x94, 0x12, 0x46, 0x17, 0x06, 0xda, 0xa0, 0xc4, 0x90, 0xc4, 0x06, 0x76, 0xa7,
142         0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x9b, 0xe0, 0x69, 0x75, 0xe2, 0x00, 0x00, 0x00,