/
chat-service.pb.go
190 lines (164 loc) · 6.55 KB
/
chat-service.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
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: chat-service.proto
package alpha
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
domain "github.com/ivohutasoit/alira/model/domain"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
// 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.ProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("chat-service.proto", fileDescriptor_39b24d53d06cfad2) }
var fileDescriptor_39b24d53d06cfad2 = []byte{
// 187 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0xce, 0x48, 0x2c,
0xd1, 0x2d, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62,
0x87, 0x72, 0xa5, 0xa4, 0xd3, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, 0xc2, 0x49, 0xa5, 0x69,
0xfa, 0xa9, 0xb9, 0x05, 0x25, 0x95, 0x10, 0x55, 0x52, 0x72, 0xe8, 0x92, 0xe5, 0x45, 0x89, 0x05,
0x05, 0xa9, 0x45, 0xc5, 0x50, 0x79, 0xc1, 0x94, 0xfc, 0xdc, 0xc4, 0xcc, 0x3c, 0x7d, 0x90, 0x05,
0x10, 0x21, 0xa3, 0x06, 0x46, 0x2e, 0x6e, 0xe7, 0x8c, 0xc4, 0x92, 0x60, 0x88, 0xf9, 0x42, 0x36,
0x5c, 0x2c, 0xc1, 0xa9, 0x79, 0x29, 0x42, 0x32, 0x7a, 0x10, 0xb3, 0xf4, 0x60, 0x66, 0xe9, 0x05,
0x97, 0x14, 0x65, 0xe6, 0xa5, 0x87, 0x25, 0xe6, 0x94, 0xa6, 0x4a, 0x89, 0x61, 0xc8, 0xba, 0x82,
0x9c, 0x21, 0x64, 0xcc, 0xc5, 0x19, 0x5c, 0x9a, 0x54, 0x9c, 0x5c, 0x94, 0x99, 0x94, 0x2a, 0x84,
0x43, 0x91, 0x14, 0x8f, 0x1e, 0xc4, 0x19, 0x7a, 0x20, 0x7b, 0x0d, 0x18, 0x9d, 0xf8, 0xa3, 0x78,
0xa1, 0xbe, 0xd3, 0x4f, 0xcc, 0x29, 0xc8, 0x48, 0x4c, 0x62, 0x03, 0x6b, 0x30, 0x06, 0x04, 0x00,
0x00, 0xff, 0xff, 0x6c, 0xf4, 0x6f, 0x7d, 0x09, 0x01, 0x00, 0x00,
}
// 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
// ChatServiceClient is the client API for ChatService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ChatServiceClient interface {
Send(ctx context.Context, in *wrappers.StringValue, opts ...grpc.CallOption) (*empty.Empty, error)
Subscribe(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (ChatService_SubscribeClient, error)
}
type chatServiceClient struct {
cc *grpc.ClientConn
}
func NewChatServiceClient(cc *grpc.ClientConn) ChatServiceClient {
return &chatServiceClient{cc}
}
func (c *chatServiceClient) Send(ctx context.Context, in *wrappers.StringValue, opts ...grpc.CallOption) (*empty.Empty, error) {
out := new(empty.Empty)
err := c.cc.Invoke(ctx, "/service.ChatService/Send", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *chatServiceClient) Subscribe(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (ChatService_SubscribeClient, error) {
stream, err := c.cc.NewStream(ctx, &_ChatService_serviceDesc.Streams[0], "/service.ChatService/Subscribe", opts...)
if err != nil {
return nil, err
}
x := &chatServiceSubscribeClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type ChatService_SubscribeClient interface {
Recv() (*domain.Chat, error)
grpc.ClientStream
}
type chatServiceSubscribeClient struct {
grpc.ClientStream
}
func (x *chatServiceSubscribeClient) Recv() (*domain.Chat, error) {
m := new(domain.Chat)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// ChatServiceServer is the server API for ChatService service.
type ChatServiceServer interface {
Send(context.Context, *wrappers.StringValue) (*empty.Empty, error)
Subscribe(*empty.Empty, ChatService_SubscribeServer) error
}
// UnimplementedChatServiceServer can be embedded to have forward compatible implementations.
type UnimplementedChatServiceServer struct {
}
func (*UnimplementedChatServiceServer) Send(ctx context.Context, req *wrappers.StringValue) (*empty.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Send not implemented")
}
func (*UnimplementedChatServiceServer) Subscribe(req *empty.Empty, srv ChatService_SubscribeServer) error {
return status.Errorf(codes.Unimplemented, "method Subscribe not implemented")
}
func RegisterChatServiceServer(s *grpc.Server, srv ChatServiceServer) {
s.RegisterService(&_ChatService_serviceDesc, srv)
}
func _ChatService_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(wrappers.StringValue)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChatServiceServer).Send(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/service.ChatService/Send",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChatServiceServer).Send(ctx, req.(*wrappers.StringValue))
}
return interceptor(ctx, in, info, handler)
}
func _ChatService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(empty.Empty)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ChatServiceServer).Subscribe(m, &chatServiceSubscribeServer{stream})
}
type ChatService_SubscribeServer interface {
Send(*domain.Chat) error
grpc.ServerStream
}
type chatServiceSubscribeServer struct {
grpc.ServerStream
}
func (x *chatServiceSubscribeServer) Send(m *domain.Chat) error {
return x.ServerStream.SendMsg(m)
}
var _ChatService_serviceDesc = grpc.ServiceDesc{
ServiceName: "service.ChatService",
HandlerType: (*ChatServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Send",
Handler: _ChatService_Send_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Subscribe",
Handler: _ChatService_Subscribe_Handler,
ServerStreams: true,
},
},
Metadata: "chat-service.proto",
}