-
Notifications
You must be signed in to change notification settings - Fork 0
/
commandstation.pb.go
271 lines (233 loc) · 9.46 KB
/
commandstation.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
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: commandstation.proto
package v1
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
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("commandstation.proto", fileDescriptor_2383d9124325f33a) }
var fileDescriptor_2383d9124325f33a = []byte{
// 229 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0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 0x90,
0x59, 0xac, 0x5f, 0x66, 0xb8, 0x8a, 0x49, 0x00, 0x26, 0xa4, 0xe7, 0x58, 0x90, 0x59, 0xac, 0x17,
0x66, 0x98, 0xc4, 0x06, 0x0e, 0x15, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x66, 0x99, 0x87,
0x81, 0x47, 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
// CommandStationServiceClient is the client API for CommandStationService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type CommandStationServiceClient interface {
// GetInfo returns information from the command station.
GetInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CommandStationInfo, error)
// Power is used to send power requests and receive power request & actual changes.
Power(ctx context.Context, opts ...grpc.CallOption) (CommandStationService_PowerClient, error)
// Locs is used to control locs and get changes in loc requests & actual state back.
// Note: Loc.actual on incoming objects is ignored.
Locs(ctx context.Context, opts ...grpc.CallOption) (CommandStationService_LocsClient, error)
}
type commandStationServiceClient struct {
cc *grpc.ClientConn
}
func NewCommandStationServiceClient(cc *grpc.ClientConn) CommandStationServiceClient {
return &commandStationServiceClient{cc}
}
func (c *commandStationServiceClient) GetInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CommandStationInfo, error) {
out := new(CommandStationInfo)
err := c.cc.Invoke(ctx, "/binkynet.v1.CommandStationService/GetInfo", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *commandStationServiceClient) Power(ctx context.Context, opts ...grpc.CallOption) (CommandStationService_PowerClient, error) {
stream, err := c.cc.NewStream(ctx, &_CommandStationService_serviceDesc.Streams[0], "/binkynet.v1.CommandStationService/Power", opts...)
if err != nil {
return nil, err
}
x := &commandStationServicePowerClient{stream}
return x, nil
}
type CommandStationService_PowerClient interface {
Send(*PowerState) error
Recv() (*Power, error)
grpc.ClientStream
}
type commandStationServicePowerClient struct {
grpc.ClientStream
}
func (x *commandStationServicePowerClient) Send(m *PowerState) error {
return x.ClientStream.SendMsg(m)
}
func (x *commandStationServicePowerClient) Recv() (*Power, error) {
m := new(Power)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *commandStationServiceClient) Locs(ctx context.Context, opts ...grpc.CallOption) (CommandStationService_LocsClient, error) {
stream, err := c.cc.NewStream(ctx, &_CommandStationService_serviceDesc.Streams[1], "/binkynet.v1.CommandStationService/Locs", opts...)
if err != nil {
return nil, err
}
x := &commandStationServiceLocsClient{stream}
return x, nil
}
type CommandStationService_LocsClient interface {
Send(*Loc) error
Recv() (*Loc, error)
grpc.ClientStream
}
type commandStationServiceLocsClient struct {
grpc.ClientStream
}
func (x *commandStationServiceLocsClient) Send(m *Loc) error {
return x.ClientStream.SendMsg(m)
}
func (x *commandStationServiceLocsClient) Recv() (*Loc, error) {
m := new(Loc)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// CommandStationServiceServer is the server API for CommandStationService service.
type CommandStationServiceServer interface {
// GetInfo returns information from the command station.
GetInfo(context.Context, *Empty) (*CommandStationInfo, error)
// Power is used to send power requests and receive power request & actual changes.
Power(CommandStationService_PowerServer) error
// Locs is used to control locs and get changes in loc requests & actual state back.
// Note: Loc.actual on incoming objects is ignored.
Locs(CommandStationService_LocsServer) error
}
// UnimplementedCommandStationServiceServer can be embedded to have forward compatible implementations.
type UnimplementedCommandStationServiceServer struct {
}
func (*UnimplementedCommandStationServiceServer) GetInfo(ctx context.Context, req *Empty) (*CommandStationInfo, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
}
func (*UnimplementedCommandStationServiceServer) Power(srv CommandStationService_PowerServer) error {
return status.Errorf(codes.Unimplemented, "method Power not implemented")
}
func (*UnimplementedCommandStationServiceServer) Locs(srv CommandStationService_LocsServer) error {
return status.Errorf(codes.Unimplemented, "method Locs not implemented")
}
func RegisterCommandStationServiceServer(s *grpc.Server, srv CommandStationServiceServer) {
s.RegisterService(&_CommandStationService_serviceDesc, srv)
}
func _CommandStationService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CommandStationServiceServer).GetInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/binkynet.v1.CommandStationService/GetInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CommandStationServiceServer).GetInfo(ctx, req.(*Empty))
}
return interceptor(ctx, in, info, handler)
}
func _CommandStationService_Power_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(CommandStationServiceServer).Power(&commandStationServicePowerServer{stream})
}
type CommandStationService_PowerServer interface {
Send(*Power) error
Recv() (*PowerState, error)
grpc.ServerStream
}
type commandStationServicePowerServer struct {
grpc.ServerStream
}
func (x *commandStationServicePowerServer) Send(m *Power) error {
return x.ServerStream.SendMsg(m)
}
func (x *commandStationServicePowerServer) Recv() (*PowerState, error) {
m := new(PowerState)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _CommandStationService_Locs_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(CommandStationServiceServer).Locs(&commandStationServiceLocsServer{stream})
}
type CommandStationService_LocsServer interface {
Send(*Loc) error
Recv() (*Loc, error)
grpc.ServerStream
}
type commandStationServiceLocsServer struct {
grpc.ServerStream
}
func (x *commandStationServiceLocsServer) Send(m *Loc) error {
return x.ServerStream.SendMsg(m)
}
func (x *commandStationServiceLocsServer) Recv() (*Loc, error) {
m := new(Loc)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _CommandStationService_serviceDesc = grpc.ServiceDesc{
ServiceName: "binkynet.v1.CommandStationService",
HandlerType: (*CommandStationServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetInfo",
Handler: _CommandStationService_GetInfo_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Power",
Handler: _CommandStationService_Power_Handler,
ServerStreams: true,
ClientStreams: true,
},
{
StreamName: "Locs",
Handler: _CommandStationService_Locs_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "commandstation.proto",
}