/
hello.pb.go
201 lines (174 loc) · 6.85 KB
/
hello.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: hello.proto
package proto
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type SayHelloRequest struct {
YourName string `protobuf:"bytes,1,opt,name=yourName,proto3" json:"yourName,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SayHelloRequest) Reset() { *m = SayHelloRequest{} }
func (m *SayHelloRequest) String() string { return proto.CompactTextString(m) }
func (*SayHelloRequest) ProtoMessage() {}
func (*SayHelloRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_hello_d427d9d1f970ff6b, []int{0}
}
func (m *SayHelloRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SayHelloRequest.Unmarshal(m, b)
}
func (m *SayHelloRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SayHelloRequest.Marshal(b, m, deterministic)
}
func (dst *SayHelloRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SayHelloRequest.Merge(dst, src)
}
func (m *SayHelloRequest) XXX_Size() int {
return xxx_messageInfo_SayHelloRequest.Size(m)
}
func (m *SayHelloRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SayHelloRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SayHelloRequest proto.InternalMessageInfo
func (m *SayHelloRequest) GetYourName() string {
if m != nil {
return m.YourName
}
return ""
}
func (m *SayHelloRequest) GetPassword() string {
if m != nil {
return m.Password
}
return ""
}
type SayHelloResponse struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SayHelloResponse) Reset() { *m = SayHelloResponse{} }
func (m *SayHelloResponse) String() string { return proto.CompactTextString(m) }
func (*SayHelloResponse) ProtoMessage() {}
func (*SayHelloResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_hello_d427d9d1f970ff6b, []int{1}
}
func (m *SayHelloResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SayHelloResponse.Unmarshal(m, b)
}
func (m *SayHelloResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SayHelloResponse.Marshal(b, m, deterministic)
}
func (dst *SayHelloResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SayHelloResponse.Merge(dst, src)
}
func (m *SayHelloResponse) XXX_Size() int {
return xxx_messageInfo_SayHelloResponse.Size(m)
}
func (m *SayHelloResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SayHelloResponse.DiscardUnknown(m)
}
var xxx_messageInfo_SayHelloResponse proto.InternalMessageInfo
func (m *SayHelloResponse) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
func init() {
proto.RegisterType((*SayHelloRequest)(nil), "proto.SayHelloRequest")
proto.RegisterType((*SayHelloResponse)(nil), "proto.SayHelloResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// HelloClient is the client API for Hello service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type HelloClient interface {
SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error)
}
type helloClient struct {
cc *grpc.ClientConn
}
func NewHelloClient(cc *grpc.ClientConn) HelloClient {
return &helloClient{cc}
}
func (c *helloClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) {
out := new(SayHelloResponse)
err := c.cc.Invoke(ctx, "/proto.Hello/sayHello", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// HelloServer is the server API for Hello service.
type HelloServer interface {
SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error)
}
func RegisterHelloServer(s *grpc.Server, srv HelloServer) {
s.RegisterService(&_Hello_serviceDesc, srv)
}
func _Hello_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SayHelloRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(HelloServer).SayHello(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/proto.Hello/SayHello",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(HelloServer).SayHello(ctx, req.(*SayHelloRequest))
}
return interceptor(ctx, in, info, handler)
}
var _Hello_serviceDesc = grpc.ServiceDesc{
ServiceName: "proto.Hello",
HandlerType: (*HelloServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "sayHello",
Handler: _Hello_SayHello_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "hello.proto",
}
func init() { proto.RegisterFile("hello.proto", fileDescriptor_hello_d427d9d1f970ff6b) }
var fileDescriptor_hello_d427d9d1f970ff6b = []byte{
// 153 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x48, 0xcd, 0xc9,
0xc9, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x53, 0x4a, 0x9e, 0x5c, 0xfc, 0xc1,
0x89, 0x95, 0x1e, 0x20, 0x89, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x12, 0x21, 0x29, 0x2e, 0x8e,
0xca, 0xfc, 0xd2, 0x22, 0xbf, 0xc4, 0xdc, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x38,
0x1f, 0x24, 0x57, 0x90, 0x58, 0x5c, 0x5c, 0x9e, 0x5f, 0x94, 0x22, 0xc1, 0x04, 0x91, 0x83, 0xf1,
0x95, 0x74, 0xb8, 0x04, 0x10, 0x46, 0x15, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0x49, 0x70, 0xb1,
0xe7, 0xa6, 0x16, 0x17, 0x27, 0xa6, 0xc3, 0x8c, 0x82, 0x71, 0x8d, 0xdc, 0xb8, 0x58, 0xc1, 0x4a,
0x85, 0x6c, 0xb9, 0x38, 0x8a, 0xa1, 0xda, 0x84, 0xc4, 0x20, 0x8e, 0xd3, 0x43, 0x73, 0x92, 0x94,
0x38, 0x86, 0x38, 0xc4, 0x7c, 0x25, 0x86, 0x24, 0x36, 0xb0, 0x8c, 0x31, 0x20, 0x00, 0x00, 0xff,
0xff, 0x8d, 0x4d, 0x79, 0xfb, 0xdd, 0x00, 0x00, 0x00,
}