-
Notifications
You must be signed in to change notification settings - Fork 1
/
gochat.pb.go
189 lines (154 loc) · 5.15 KB
/
gochat.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
// Code generated by protoc-gen-go.
// source: gochat.proto
// DO NOT EDIT!
/*
Package gochat is a generated protocol buffer package.
It is generated from these files:
gochat.proto
It has these top-level messages:
ChatMessage
*/
package gochat
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 ChatMessage struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"`
Group string `protobuf:"bytes,3,opt,name=group" json:"group,omitempty"`
}
func (m *ChatMessage) Reset() { *m = ChatMessage{} }
func (m *ChatMessage) String() string { return proto.CompactTextString(m) }
func (*ChatMessage) ProtoMessage() {}
func (*ChatMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *ChatMessage) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *ChatMessage) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
func (m *ChatMessage) GetGroup() string {
if m != nil {
return m.Group
}
return ""
}
func init() {
proto.RegisterType((*ChatMessage)(nil), "gochat.ChatMessage")
}
// 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
// Client API for GroupChat service
type GroupChatClient interface {
Chat(ctx context.Context, opts ...grpc.CallOption) (GroupChat_ChatClient, error)
}
type groupChatClient struct {
cc *grpc.ClientConn
}
func NewGroupChatClient(cc *grpc.ClientConn) GroupChatClient {
return &groupChatClient{cc}
}
func (c *groupChatClient) Chat(ctx context.Context, opts ...grpc.CallOption) (GroupChat_ChatClient, error) {
stream, err := grpc.NewClientStream(ctx, &_GroupChat_serviceDesc.Streams[0], c.cc, "/gochat.GroupChat/Chat", opts...)
if err != nil {
return nil, err
}
x := &groupChatChatClient{stream}
return x, nil
}
type GroupChat_ChatClient interface {
Send(*ChatMessage) error
Recv() (*ChatMessage, error)
grpc.ClientStream
}
type groupChatChatClient struct {
grpc.ClientStream
}
func (x *groupChatChatClient) Send(m *ChatMessage) error {
return x.ClientStream.SendMsg(m)
}
func (x *groupChatChatClient) Recv() (*ChatMessage, error) {
m := new(ChatMessage)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Server API for GroupChat service
type GroupChatServer interface {
Chat(GroupChat_ChatServer) error
}
func RegisterGroupChatServer(s *grpc.Server, srv GroupChatServer) {
s.RegisterService(&_GroupChat_serviceDesc, srv)
}
func _GroupChat_Chat_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(GroupChatServer).Chat(&groupChatChatServer{stream})
}
type GroupChat_ChatServer interface {
Send(*ChatMessage) error
Recv() (*ChatMessage, error)
grpc.ServerStream
}
type groupChatChatServer struct {
grpc.ServerStream
}
func (x *groupChatChatServer) Send(m *ChatMessage) error {
return x.ServerStream.SendMsg(m)
}
func (x *groupChatChatServer) Recv() (*ChatMessage, error) {
m := new(ChatMessage)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _GroupChat_serviceDesc = grpc.ServiceDesc{
ServiceName: "gochat.GroupChat",
HandlerType: (*GroupChatServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Chat",
Handler: _GroupChat_Chat_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "gochat.proto",
}
func init() { proto.RegisterFile("gochat.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 136 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0xcf, 0x4f, 0xce,
0x48, 0x2c, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0xf0, 0x94, 0x02, 0xb9, 0xb8,
0x9d, 0x33, 0x12, 0x4b, 0x7c, 0x53, 0x8b, 0x8b, 0x13, 0xd3, 0x53, 0x85, 0x84, 0xb8, 0x58, 0xf2,
0x12, 0x73, 0x53, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83, 0xc0, 0x6c, 0x21, 0x09, 0x2e, 0xf6,
0x5c, 0x88, 0xb4, 0x04, 0x13, 0x58, 0x18, 0xc6, 0x15, 0x12, 0xe1, 0x62, 0x4d, 0x2f, 0xca, 0x2f,
0x2d, 0x90, 0x60, 0x06, 0x8b, 0x43, 0x38, 0x46, 0xce, 0x5c, 0x9c, 0xee, 0x20, 0x06, 0xc8, 0x5c,
0x21, 0x33, 0x2e, 0x16, 0x30, 0x2d, 0xac, 0x07, 0xb5, 0x1e, 0xc9, 0x36, 0x29, 0x6c, 0x82, 0x4a,
0x0c, 0x1a, 0x8c, 0x06, 0x8c, 0x49, 0x6c, 0x60, 0x67, 0x1a, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff,
0xc8, 0x38, 0xfe, 0xf8, 0xb6, 0x00, 0x00, 0x00,
}