/
bar.pb.go
98 lines (79 loc) · 2.17 KB
/
bar.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Code generated by protoc-gen-go.
// source: bar.proto
// DO NOT EDIT!
/*
Package bar is a generated protocol buffer package.
It is generated from these files:
bar.proto
It has these top-level messages:
TestRep
*/
package pb3
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type TestRep struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
}
func (m *TestRep) Reset() { *m = TestRep{} }
func (m *TestRep) String() string { return proto.CompactTextString(m) }
func (*TestRep) ProtoMessage() {}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// Client API for Bar service
type BarClient interface {
Test(ctx context.Context, in *TestRep, opts ...grpc.CallOption) (*TestRep, error)
}
type barClient struct {
cc *grpc.ClientConn
}
func NewBarClient(cc *grpc.ClientConn) BarClient {
return &barClient{cc}
}
func (c *barClient) Test(ctx context.Context, in *TestRep, opts ...grpc.CallOption) (*TestRep, error) {
out := new(TestRep)
err := grpc.Invoke(ctx, "/.Bar/Test", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Bar service
type BarServer interface {
Test(context.Context, *TestRep) (*TestRep, error)
}
func RegisterBarServer(s *grpc.Server, srv BarServer) {
s.RegisterService(&_Bar_serviceDesc, srv)
}
func _Bar_Test_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(TestRep)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(BarServer).Test(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
var _Bar_serviceDesc = grpc.ServiceDesc{
ServiceName: ".Bar",
HandlerType: (*BarServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Test",
Handler: _Bar_Test_Handler,
},
},
Streams: []grpc.StreamDesc{},
}