-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathterminal.pb.go
384 lines (332 loc) · 12.1 KB
/
terminal.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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: terminal.proto
package terminal
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
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.ProtoPackageIsVersion2 // please upgrade the proto package
type TerminalResize struct {
Columns int32 `protobuf:"varint,1,opt,name=columns,proto3" json:"columns,omitempty"`
Rows int32 `protobuf:"varint,2,opt,name=rows,proto3" json:"rows,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *TerminalResize) Reset() { *m = TerminalResize{} }
func (m *TerminalResize) String() string { return proto.CompactTextString(m) }
func (*TerminalResize) ProtoMessage() {}
func (*TerminalResize) Descriptor() ([]byte, []int) {
return fileDescriptor_ff8b8260c8ef16ad, []int{0}
}
func (m *TerminalResize) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TerminalResize.Unmarshal(m, b)
}
func (m *TerminalResize) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_TerminalResize.Marshal(b, m, deterministic)
}
func (m *TerminalResize) XXX_Merge(src proto.Message) {
xxx_messageInfo_TerminalResize.Merge(m, src)
}
func (m *TerminalResize) XXX_Size() int {
return xxx_messageInfo_TerminalResize.Size(m)
}
func (m *TerminalResize) XXX_DiscardUnknown() {
xxx_messageInfo_TerminalResize.DiscardUnknown(m)
}
var xxx_messageInfo_TerminalResize proto.InternalMessageInfo
func (m *TerminalResize) GetColumns() int32 {
if m != nil {
return m.Columns
}
return 0
}
func (m *TerminalResize) GetRows() int32 {
if m != nil {
return m.Rows
}
return 0
}
type SessionRequest struct {
// Types that are valid to be assigned to Command:
// *SessionRequest_Message
// *SessionRequest_Resize
Command isSessionRequest_Command `protobuf_oneof:"command"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SessionRequest) Reset() { *m = SessionRequest{} }
func (m *SessionRequest) String() string { return proto.CompactTextString(m) }
func (*SessionRequest) ProtoMessage() {}
func (*SessionRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_ff8b8260c8ef16ad, []int{1}
}
func (m *SessionRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SessionRequest.Unmarshal(m, b)
}
func (m *SessionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SessionRequest.Marshal(b, m, deterministic)
}
func (m *SessionRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SessionRequest.Merge(m, src)
}
func (m *SessionRequest) XXX_Size() int {
return xxx_messageInfo_SessionRequest.Size(m)
}
func (m *SessionRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SessionRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SessionRequest proto.InternalMessageInfo
type isSessionRequest_Command interface {
isSessionRequest_Command()
}
type SessionRequest_Message struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3,oneof"`
}
type SessionRequest_Resize struct {
Resize *TerminalResize `protobuf:"bytes,2,opt,name=resize,proto3,oneof"`
}
func (*SessionRequest_Message) isSessionRequest_Command() {}
func (*SessionRequest_Resize) isSessionRequest_Command() {}
func (m *SessionRequest) GetCommand() isSessionRequest_Command {
if m != nil {
return m.Command
}
return nil
}
func (m *SessionRequest) GetMessage() string {
if x, ok := m.GetCommand().(*SessionRequest_Message); ok {
return x.Message
}
return ""
}
func (m *SessionRequest) GetResize() *TerminalResize {
if x, ok := m.GetCommand().(*SessionRequest_Resize); ok {
return x.Resize
}
return nil
}
// XXX_OneofFuncs is for the internal use of the proto package.
func (*SessionRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) {
return _SessionRequest_OneofMarshaler, _SessionRequest_OneofUnmarshaler, _SessionRequest_OneofSizer, []interface{}{
(*SessionRequest_Message)(nil),
(*SessionRequest_Resize)(nil),
}
}
func _SessionRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error {
m := msg.(*SessionRequest)
// command
switch x := m.Command.(type) {
case *SessionRequest_Message:
b.EncodeVarint(1<<3 | proto.WireBytes)
b.EncodeStringBytes(x.Message)
case *SessionRequest_Resize:
b.EncodeVarint(2<<3 | proto.WireBytes)
if err := b.EncodeMessage(x.Resize); err != nil {
return err
}
case nil:
default:
return fmt.Errorf("SessionRequest.Command has unexpected type %T", x)
}
return nil
}
func _SessionRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) {
m := msg.(*SessionRequest)
switch tag {
case 1: // command.message
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
x, err := b.DecodeStringBytes()
m.Command = &SessionRequest_Message{x}
return true, err
case 2: // command.resize
if wire != proto.WireBytes {
return true, proto.ErrInternalBadWireType
}
msg := new(TerminalResize)
err := b.DecodeMessage(msg)
m.Command = &SessionRequest_Resize{msg}
return true, err
default:
return false, nil
}
}
func _SessionRequest_OneofSizer(msg proto.Message) (n int) {
m := msg.(*SessionRequest)
// command
switch x := m.Command.(type) {
case *SessionRequest_Message:
n += 1 // tag and wire
n += proto.SizeVarint(uint64(len(x.Message)))
n += len(x.Message)
case *SessionRequest_Resize:
s := proto.Size(x.Resize)
n += 1 // tag and wire
n += proto.SizeVarint(uint64(s))
n += s
case nil:
default:
panic(fmt.Sprintf("proto: unexpected type %T in oneof", x))
}
return n
}
type SessionResponse 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 *SessionResponse) Reset() { *m = SessionResponse{} }
func (m *SessionResponse) String() string { return proto.CompactTextString(m) }
func (*SessionResponse) ProtoMessage() {}
func (*SessionResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_ff8b8260c8ef16ad, []int{2}
}
func (m *SessionResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SessionResponse.Unmarshal(m, b)
}
func (m *SessionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SessionResponse.Marshal(b, m, deterministic)
}
func (m *SessionResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SessionResponse.Merge(m, src)
}
func (m *SessionResponse) XXX_Size() int {
return xxx_messageInfo_SessionResponse.Size(m)
}
func (m *SessionResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SessionResponse.DiscardUnknown(m)
}
var xxx_messageInfo_SessionResponse proto.InternalMessageInfo
func (m *SessionResponse) GetMessage() string {
if m != nil {
return m.Message
}
return ""
}
func init() {
proto.RegisterType((*TerminalResize)(nil), "terminal.TerminalResize")
proto.RegisterType((*SessionRequest)(nil), "terminal.SessionRequest")
proto.RegisterType((*SessionResponse)(nil), "terminal.SessionResponse")
}
func init() { proto.RegisterFile("terminal.proto", fileDescriptor_ff8b8260c8ef16ad) }
var fileDescriptor_ff8b8260c8ef16ad = []byte{
// 247 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xcf, 0x4a, 0xc4, 0x40,
0x0c, 0x87, 0xb7, 0x8b, 0x6e, 0x6d, 0x16, 0x2a, 0xe6, 0x54, 0x8b, 0x07, 0xe9, 0x69, 0x41, 0xd8,
0x4a, 0xbd, 0x7b, 0xf0, 0xb4, 0xe7, 0x51, 0x1f, 0x60, 0xd4, 0x50, 0x06, 0x3b, 0x93, 0xda, 0xcc,
0x22, 0x78, 0xf4, 0x15, 0x7c, 0x34, 0x5f, 0xc1, 0x07, 0x11, 0xa7, 0x7f, 0xb0, 0xb0, 0xb7, 0x49,
0xe6, 0x97, 0x7c, 0x1f, 0x81, 0xd4, 0x53, 0x67, 0x8d, 0xd3, 0xcd, 0xb6, 0xed, 0xd8, 0x33, 0x9e,
0x8c, 0x75, 0x7e, 0x51, 0x33, 0xd7, 0x0d, 0x95, 0xba, 0x35, 0xa5, 0x76, 0x8e, 0xbd, 0xf6, 0x86,
0x9d, 0xf4, 0xb9, 0xe2, 0x16, 0xd2, 0x87, 0x21, 0xa9, 0x48, 0xcc, 0x07, 0x61, 0x06, 0xf1, 0x33,
0x37, 0x7b, 0xeb, 0x24, 0x8b, 0x2e, 0xa3, 0xcd, 0xb1, 0x1a, 0x4b, 0x44, 0x38, 0xea, 0xf8, 0x5d,
0xb2, 0x65, 0x68, 0x87, 0x77, 0xf1, 0x0a, 0xe9, 0x3d, 0x89, 0x18, 0x76, 0x8a, 0xde, 0xf6, 0x24,
0x1e, 0x73, 0x88, 0x2d, 0x89, 0xe8, 0x9a, 0xc2, 0x7c, 0xb2, 0x5b, 0xa8, 0xb1, 0x81, 0x15, 0xac,
0xba, 0x40, 0x09, 0x3b, 0xd6, 0x55, 0xb6, 0x9d, 0xb4, 0xe7, 0x16, 0xbb, 0x85, 0x1a, 0x92, 0x77,
0xc9, 0x9f, 0x8f, 0xb5, 0xda, 0xbd, 0x14, 0x57, 0x70, 0x3a, 0xc1, 0xa4, 0x65, 0x27, 0xc1, 0x76,
0x46, 0x9b, 0x58, 0x95, 0x86, 0xe9, 0x06, 0xf8, 0x08, 0xf1, 0x30, 0x88, 0xff, 0x90, 0x73, 0xf1,
0xfc, 0xfc, 0xc0, 0x4f, 0x4f, 0x29, 0xce, 0x3e, 0xbf, 0x7f, 0xbe, 0x96, 0x6b, 0x4c, 0xca, 0x31,
0xb2, 0x89, 0xae, 0xa3, 0xa7, 0x55, 0xb8, 0xe1, 0xcd, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x23,
0x32, 0x28, 0x45, 0x7d, 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
// TerminalClient is the client API for Terminal service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type TerminalClient interface {
Session(ctx context.Context, opts ...grpc.CallOption) (Terminal_SessionClient, error)
}
type terminalClient struct {
cc *grpc.ClientConn
}
func NewTerminalClient(cc *grpc.ClientConn) TerminalClient {
return &terminalClient{cc}
}
func (c *terminalClient) Session(ctx context.Context, opts ...grpc.CallOption) (Terminal_SessionClient, error) {
stream, err := c.cc.NewStream(ctx, &_Terminal_serviceDesc.Streams[0], "/terminal.terminal/Session", opts...)
if err != nil {
return nil, err
}
x := &terminalSessionClient{stream}
return x, nil
}
type Terminal_SessionClient interface {
Send(*SessionRequest) error
Recv() (*SessionResponse, error)
grpc.ClientStream
}
type terminalSessionClient struct {
grpc.ClientStream
}
func (x *terminalSessionClient) Send(m *SessionRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *terminalSessionClient) Recv() (*SessionResponse, error) {
m := new(SessionResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// TerminalServer is the server API for Terminal service.
type TerminalServer interface {
Session(Terminal_SessionServer) error
}
func RegisterTerminalServer(s *grpc.Server, srv TerminalServer) {
s.RegisterService(&_Terminal_serviceDesc, srv)
}
func _Terminal_Session_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(TerminalServer).Session(&terminalSessionServer{stream})
}
type Terminal_SessionServer interface {
Send(*SessionResponse) error
Recv() (*SessionRequest, error)
grpc.ServerStream
}
type terminalSessionServer struct {
grpc.ServerStream
}
func (x *terminalSessionServer) Send(m *SessionResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *terminalSessionServer) Recv() (*SessionRequest, error) {
m := new(SessionRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _Terminal_serviceDesc = grpc.ServiceDesc{
ServiceName: "terminal.terminal",
HandlerType: (*TerminalServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Session",
Handler: _Terminal_Session_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "terminal.proto",
}