github.com/binkynet/BinkyNet@v1.12.1-0.20240421190447-da4e34c20be0/apis/v1/network.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: network.proto 3 4 package v1 5 6 import ( 7 context "context" 8 fmt "fmt" 9 proto "github.com/golang/protobuf/proto" 10 grpc "google.golang.org/grpc" 11 codes "google.golang.org/grpc/codes" 12 status "google.golang.org/grpc/status" 13 io "io" 14 math "math" 15 math_bits "math/bits" 16 ) 17 18 // Reference imports to suppress errors if they are not otherwise used. 19 var _ = proto.Marshal 20 var _ = fmt.Errorf 21 var _ = math.Inf 22 23 // This is a compile-time assertion to ensure that this generated file 24 // is compatible with the proto package it is being compiled against. 25 // A compilation error at this line likely means your copy of the 26 // proto package needs to be updated. 27 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 28 29 type WatchOptions struct { 30 // If set, send changes in request state 31 WatchRequestChanges bool `protobuf:"varint,1,opt,name=watch_request_changes,json=watchRequestChanges,proto3" json:"watch_request_changes,omitempty"` 32 // If set, send changes in actual state 33 WatchActualChanges bool `protobuf:"varint,2,opt,name=watch_actual_changes,json=watchActualChanges,proto3" json:"watch_actual_changes,omitempty"` 34 // If set, send changes related to this and global module only 35 ModuleId string `protobuf:"bytes,3,opt,name=module_id,json=moduleId,proto3" json:"module_id,omitempty"` 36 XXX_NoUnkeyedLiteral struct{} `json:"-"` 37 XXX_unrecognized []byte `json:"-"` 38 XXX_sizecache int32 `json:"-"` 39 } 40 41 func (m *WatchOptions) Reset() { *m = WatchOptions{} } 42 func (m *WatchOptions) String() string { return proto.CompactTextString(m) } 43 func (*WatchOptions) ProtoMessage() {} 44 func (*WatchOptions) Descriptor() ([]byte, []int) { 45 return fileDescriptor_8571034d60397816, []int{0} 46 } 47 func (m *WatchOptions) XXX_Unmarshal(b []byte) error { 48 return m.Unmarshal(b) 49 } 50 func (m *WatchOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 51 if deterministic { 52 return xxx_messageInfo_WatchOptions.Marshal(b, m, deterministic) 53 } else { 54 b = b[:cap(b)] 55 n, err := m.MarshalToSizedBuffer(b) 56 if err != nil { 57 return nil, err 58 } 59 return b[:n], nil 60 } 61 } 62 func (m *WatchOptions) XXX_Merge(src proto.Message) { 63 xxx_messageInfo_WatchOptions.Merge(m, src) 64 } 65 func (m *WatchOptions) XXX_Size() int { 66 return m.Size() 67 } 68 func (m *WatchOptions) XXX_DiscardUnknown() { 69 xxx_messageInfo_WatchOptions.DiscardUnknown(m) 70 } 71 72 var xxx_messageInfo_WatchOptions proto.InternalMessageInfo 73 74 func (m *WatchOptions) GetWatchRequestChanges() bool { 75 if m != nil { 76 return m.WatchRequestChanges 77 } 78 return false 79 } 80 81 func (m *WatchOptions) GetWatchActualChanges() bool { 82 if m != nil { 83 return m.WatchActualChanges 84 } 85 return false 86 } 87 88 func (m *WatchOptions) GetModuleId() string { 89 if m != nil { 90 return m.ModuleId 91 } 92 return "" 93 } 94 95 func init() { 96 proto.RegisterType((*WatchOptions)(nil), "binkynet.v1.WatchOptions") 97 } 98 99 func init() { proto.RegisterFile("network.proto", fileDescriptor_8571034d60397816) } 100 101 var fileDescriptor_8571034d60397816 = []byte{ 102 // 449 bytes of a gzipped FileDescriptorProto 103 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0xc1, 0x6e, 0xd3, 0x30, 104 0x18, 0xc7, 0xf1, 0x10, 0x68, 0xf3, 0x06, 0x0c, 0x6f, 0x15, 0xa5, 0xa0, 0x6a, 0x42, 0x1c, 0x76, 105 0x4a, 0xda, 0xc1, 0x01, 0x21, 0x71, 0xd8, 0xda, 0x1d, 0x86, 0xa6, 0x0d, 0x35, 0x12, 0x93, 0xb8, 106 0x54, 0xa9, 0xfb, 0x69, 0xb5, 0x92, 0xc6, 0xc1, 0xfe, 0x92, 0x28, 0x8f, 0xc1, 0x8d, 0x67, 0xe0, 107 0x49, 0x38, 0xf2, 0x08, 0x53, 0x79, 0x11, 0x54, 0x3b, 0xa9, 0x92, 0x2a, 0xab, 0xc4, 0x2d, 0xf1, 108 0xef, 0xff, 0xfb, 0xfc, 0xf9, 0x73, 0x42, 0x9f, 0x44, 0x80, 0x99, 0x54, 0x81, 0x13, 0x2b, 0x89, 109 0x92, 0xed, 0x4e, 0x44, 0x14, 0xe4, 0x11, 0xa0, 0x93, 0xf6, 0x3b, 0xbb, 0x98, 0xc7, 0xa0, 0x2d, 110 0x79, 0xf3, 0x83, 0xd0, 0xbd, 0x1b, 0x1f, 0xf9, 0xec, 0x3a, 0x46, 0x21, 0x23, 0xcd, 0x4e, 0x68, 111 0x2b, 0x5b, 0xbe, 0x8f, 0x15, 0x7c, 0x4f, 0x40, 0xe3, 0x98, 0xcf, 0xfc, 0xe8, 0x16, 0x74, 0x9b, 112 0x1c, 0x91, 0xe3, 0xed, 0xd1, 0x81, 0x81, 0x23, 0xcb, 0x06, 0x16, 0xb1, 0x1e, 0x3d, 0xb4, 0x8e, 113 0xcf, 0x31, 0xf1, 0xc3, 0x95, 0xb2, 0x65, 0x14, 0x66, 0xd8, 0xa9, 0x41, 0xa5, 0xf1, 0x8a, 0xee, 114 0xcc, 0xe5, 0x34, 0x09, 0x61, 0x2c, 0xa6, 0xed, 0x87, 0x47, 0xe4, 0x78, 0x67, 0xb4, 0x6d, 0x17, 115 0x2e, 0xa6, 0x27, 0x77, 0x8f, 0x68, 0xeb, 0xca, 0xf6, 0x3f, 0x90, 0x11, 0x2a, 0x19, 0x7a, 0xa0, 116 0x52, 0xc1, 0x81, 0x9d, 0xd3, 0x96, 0x07, 0x78, 0x29, 0xb9, 0x1f, 0xde, 0x48, 0x15, 0x80, 0x2a, 117 0x1a, 0x61, 0x6d, 0xa7, 0x72, 0x42, 0xa7, 0x12, 0xe8, 0xb0, 0x1a, 0x39, 0x9f, 0xc7, 0x98, 0xb3, 118 0x21, 0x3d, 0xac, 0x97, 0xb1, 0xcd, 0xfd, 0x67, 0x95, 0xcf, 0xf4, 0xb9, 0x99, 0x5c, 0x25, 0xa7, 119 0xd9, 0xcb, 0x5a, 0xb0, 0x3a, 0xd9, 0xce, 0xbd, 0xd5, 0x7b, 0x84, 0x5d, 0xd2, 0xb6, 0x07, 0x38, 120 0x84, 0xe5, 0x29, 0x87, 0x42, 0x73, 0x99, 0x82, 0xca, 0x8b, 0xae, 0x5e, 0xd7, 0xbc, 0xb5, 0x4c, 121 0x63, 0x67, 0x9f, 0xe8, 0x53, 0x0f, 0xf0, 0x8b, 0xcc, 0x56, 0x27, 0x7b, 0x51, 0x4b, 0x19, 0xe2, 122 0xa1, 0x8f, 0xd0, 0xa8, 0xbf, 0xa7, 0x7b, 0x76, 0x3c, 0x85, 0xbc, 0xbf, 0xde, 0x78, 0xa3, 0xf5, 123 0x91, 0x3e, 0xf3, 0x00, 0x3d, 0x88, 0xb4, 0x2c, 0x77, 0x3d, 0xa8, 0xc5, 0x2c, 0xda, 0xe0, 0x5e, 124 0x27, 0x18, 0x27, 0xd8, 0xe8, 0x5a, 0xb4, 0x69, 0xdf, 0x4c, 0xac, 0x3e, 0xb2, 0xf5, 0x7d, 0x0d, 125 0x6a, 0x74, 0x3f, 0x98, 0x41, 0x0d, 0x42, 0xc9, 0x83, 0x42, 0xad, 0xa7, 0x0c, 0xb9, 0x67, 0xc4, 126 0xd4, 0x5c, 0xae, 0x49, 0x6c, 0xba, 0xf5, 0x86, 0x82, 0x3d, 0x72, 0x76, 0xf1, 0x7b, 0xd1, 0x25, 127 0x7f, 0x16, 0x5d, 0x72, 0xb7, 0xe8, 0x92, 0x9f, 0x7f, 0xbb, 0x0f, 0xbe, 0xbd, 0xbd, 0x15, 0x38, 128 0x4b, 0x26, 0x0e, 0x97, 0x73, 0xb7, 0x34, 0xdc, 0xb3, 0xe5, 0xc3, 0x15, 0xa0, 0xeb, 0xc7, 0x42, 129 0xbb, 0x69, 0xff, 0xd7, 0xd6, 0x7e, 0xb9, 0xe4, 0x9c, 0xc6, 0x42, 0x3b, 0x5f, 0xfb, 0x93, 0xc7, 130 0xe6, 0x47, 0x7e, 0xf7, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xec, 0xe9, 0x6d, 0x23, 0xf3, 0x03, 0x00, 131 0x00, 132 } 133 134 // Reference imports to suppress errors if they are not otherwise used. 135 var _ context.Context 136 var _ grpc.ClientConn 137 138 // This is a compile-time assertion to ensure that this generated file 139 // is compatible with the grpc package it is being compiled against. 140 const _ = grpc.SupportPackageIsVersion4 141 142 // NetworkControlServiceClient is the client API for NetworkControlService service. 143 // 144 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 145 type NetworkControlServiceClient interface { 146 // Set the requested local worker state 147 SetLocalWorkerRequest(ctx context.Context, in *LocalWorker, opts ...grpc.CallOption) (*Empty, error) 148 // Set the actual local worker state 149 SetLocalWorkerActual(ctx context.Context, in *LocalWorker, opts ...grpc.CallOption) (*Empty, error) 150 // Watch local worker changes 151 WatchLocalWorkers(ctx context.Context, in *WatchOptions, opts ...grpc.CallOption) (NetworkControlService_WatchLocalWorkersClient, error) 152 // Set an actual device discovery state 153 SetDeviceDiscoveryActual(ctx context.Context, in *DeviceDiscovery, opts ...grpc.CallOption) (*Empty, error) 154 // Set the actual power state 155 SetPowerActual(ctx context.Context, in *PowerState, opts ...grpc.CallOption) (*Empty, error) 156 // Set an actual loc state 157 SetLocActual(ctx context.Context, in *Loc, opts ...grpc.CallOption) (*Empty, error) 158 // Set an actual sensor state 159 SetSensorActual(ctx context.Context, in *Sensor, opts ...grpc.CallOption) (*Empty, error) 160 // Set an actual output state 161 SetOutputActual(ctx context.Context, in *Output, opts ...grpc.CallOption) (*Empty, error) 162 // Set an actual switch state 163 SetSwitchActual(ctx context.Context, in *Switch, opts ...grpc.CallOption) (*Empty, error) 164 // Set an actual clock state 165 SetClockActual(ctx context.Context, in *Clock, opts ...grpc.CallOption) (*Empty, error) 166 // Watch clock changes 167 WatchClock(ctx context.Context, in *WatchOptions, opts ...grpc.CallOption) (NetworkControlService_WatchClockClient, error) 168 } 169 170 type networkControlServiceClient struct { 171 cc *grpc.ClientConn 172 } 173 174 func NewNetworkControlServiceClient(cc *grpc.ClientConn) NetworkControlServiceClient { 175 return &networkControlServiceClient{cc} 176 } 177 178 func (c *networkControlServiceClient) SetLocalWorkerRequest(ctx context.Context, in *LocalWorker, opts ...grpc.CallOption) (*Empty, error) { 179 out := new(Empty) 180 err := c.cc.Invoke(ctx, "/binkynet.v1.NetworkControlService/SetLocalWorkerRequest", in, out, opts...) 181 if err != nil { 182 return nil, err 183 } 184 return out, nil 185 } 186 187 func (c *networkControlServiceClient) SetLocalWorkerActual(ctx context.Context, in *LocalWorker, opts ...grpc.CallOption) (*Empty, error) { 188 out := new(Empty) 189 err := c.cc.Invoke(ctx, "/binkynet.v1.NetworkControlService/SetLocalWorkerActual", in, out, opts...) 190 if err != nil { 191 return nil, err 192 } 193 return out, nil 194 } 195 196 func (c *networkControlServiceClient) WatchLocalWorkers(ctx context.Context, in *WatchOptions, opts ...grpc.CallOption) (NetworkControlService_WatchLocalWorkersClient, error) { 197 stream, err := c.cc.NewStream(ctx, &_NetworkControlService_serviceDesc.Streams[0], "/binkynet.v1.NetworkControlService/WatchLocalWorkers", opts...) 198 if err != nil { 199 return nil, err 200 } 201 x := &networkControlServiceWatchLocalWorkersClient{stream} 202 if err := x.ClientStream.SendMsg(in); err != nil { 203 return nil, err 204 } 205 if err := x.ClientStream.CloseSend(); err != nil { 206 return nil, err 207 } 208 return x, nil 209 } 210 211 type NetworkControlService_WatchLocalWorkersClient interface { 212 Recv() (*LocalWorker, error) 213 grpc.ClientStream 214 } 215 216 type networkControlServiceWatchLocalWorkersClient struct { 217 grpc.ClientStream 218 } 219 220 func (x *networkControlServiceWatchLocalWorkersClient) Recv() (*LocalWorker, error) { 221 m := new(LocalWorker) 222 if err := x.ClientStream.RecvMsg(m); err != nil { 223 return nil, err 224 } 225 return m, nil 226 } 227 228 func (c *networkControlServiceClient) SetDeviceDiscoveryActual(ctx context.Context, in *DeviceDiscovery, opts ...grpc.CallOption) (*Empty, error) { 229 out := new(Empty) 230 err := c.cc.Invoke(ctx, "/binkynet.v1.NetworkControlService/SetDeviceDiscoveryActual", in, out, opts...) 231 if err != nil { 232 return nil, err 233 } 234 return out, nil 235 } 236 237 func (c *networkControlServiceClient) SetPowerActual(ctx context.Context, in *PowerState, opts ...grpc.CallOption) (*Empty, error) { 238 out := new(Empty) 239 err := c.cc.Invoke(ctx, "/binkynet.v1.NetworkControlService/SetPowerActual", in, out, opts...) 240 if err != nil { 241 return nil, err 242 } 243 return out, nil 244 } 245 246 func (c *networkControlServiceClient) SetLocActual(ctx context.Context, in *Loc, opts ...grpc.CallOption) (*Empty, error) { 247 out := new(Empty) 248 err := c.cc.Invoke(ctx, "/binkynet.v1.NetworkControlService/SetLocActual", in, out, opts...) 249 if err != nil { 250 return nil, err 251 } 252 return out, nil 253 } 254 255 func (c *networkControlServiceClient) SetSensorActual(ctx context.Context, in *Sensor, opts ...grpc.CallOption) (*Empty, error) { 256 out := new(Empty) 257 err := c.cc.Invoke(ctx, "/binkynet.v1.NetworkControlService/SetSensorActual", in, out, opts...) 258 if err != nil { 259 return nil, err 260 } 261 return out, nil 262 } 263 264 func (c *networkControlServiceClient) SetOutputActual(ctx context.Context, in *Output, opts ...grpc.CallOption) (*Empty, error) { 265 out := new(Empty) 266 err := c.cc.Invoke(ctx, "/binkynet.v1.NetworkControlService/SetOutputActual", in, out, opts...) 267 if err != nil { 268 return nil, err 269 } 270 return out, nil 271 } 272 273 func (c *networkControlServiceClient) SetSwitchActual(ctx context.Context, in *Switch, opts ...grpc.CallOption) (*Empty, error) { 274 out := new(Empty) 275 err := c.cc.Invoke(ctx, "/binkynet.v1.NetworkControlService/SetSwitchActual", in, out, opts...) 276 if err != nil { 277 return nil, err 278 } 279 return out, nil 280 } 281 282 func (c *networkControlServiceClient) SetClockActual(ctx context.Context, in *Clock, opts ...grpc.CallOption) (*Empty, error) { 283 out := new(Empty) 284 err := c.cc.Invoke(ctx, "/binkynet.v1.NetworkControlService/SetClockActual", in, out, opts...) 285 if err != nil { 286 return nil, err 287 } 288 return out, nil 289 } 290 291 func (c *networkControlServiceClient) WatchClock(ctx context.Context, in *WatchOptions, opts ...grpc.CallOption) (NetworkControlService_WatchClockClient, error) { 292 stream, err := c.cc.NewStream(ctx, &_NetworkControlService_serviceDesc.Streams[1], "/binkynet.v1.NetworkControlService/WatchClock", opts...) 293 if err != nil { 294 return nil, err 295 } 296 x := &networkControlServiceWatchClockClient{stream} 297 if err := x.ClientStream.SendMsg(in); err != nil { 298 return nil, err 299 } 300 if err := x.ClientStream.CloseSend(); err != nil { 301 return nil, err 302 } 303 return x, nil 304 } 305 306 type NetworkControlService_WatchClockClient interface { 307 Recv() (*Clock, error) 308 grpc.ClientStream 309 } 310 311 type networkControlServiceWatchClockClient struct { 312 grpc.ClientStream 313 } 314 315 func (x *networkControlServiceWatchClockClient) Recv() (*Clock, error) { 316 m := new(Clock) 317 if err := x.ClientStream.RecvMsg(m); err != nil { 318 return nil, err 319 } 320 return m, nil 321 } 322 323 // NetworkControlServiceServer is the server API for NetworkControlService service. 324 type NetworkControlServiceServer interface { 325 // Set the requested local worker state 326 SetLocalWorkerRequest(context.Context, *LocalWorker) (*Empty, error) 327 // Set the actual local worker state 328 SetLocalWorkerActual(context.Context, *LocalWorker) (*Empty, error) 329 // Watch local worker changes 330 WatchLocalWorkers(*WatchOptions, NetworkControlService_WatchLocalWorkersServer) error 331 // Set an actual device discovery state 332 SetDeviceDiscoveryActual(context.Context, *DeviceDiscovery) (*Empty, error) 333 // Set the actual power state 334 SetPowerActual(context.Context, *PowerState) (*Empty, error) 335 // Set an actual loc state 336 SetLocActual(context.Context, *Loc) (*Empty, error) 337 // Set an actual sensor state 338 SetSensorActual(context.Context, *Sensor) (*Empty, error) 339 // Set an actual output state 340 SetOutputActual(context.Context, *Output) (*Empty, error) 341 // Set an actual switch state 342 SetSwitchActual(context.Context, *Switch) (*Empty, error) 343 // Set an actual clock state 344 SetClockActual(context.Context, *Clock) (*Empty, error) 345 // Watch clock changes 346 WatchClock(*WatchOptions, NetworkControlService_WatchClockServer) error 347 } 348 349 // UnimplementedNetworkControlServiceServer can be embedded to have forward compatible implementations. 350 type UnimplementedNetworkControlServiceServer struct { 351 } 352 353 func (*UnimplementedNetworkControlServiceServer) SetLocalWorkerRequest(ctx context.Context, req *LocalWorker) (*Empty, error) { 354 return nil, status.Errorf(codes.Unimplemented, "method SetLocalWorkerRequest not implemented") 355 } 356 func (*UnimplementedNetworkControlServiceServer) SetLocalWorkerActual(ctx context.Context, req *LocalWorker) (*Empty, error) { 357 return nil, status.Errorf(codes.Unimplemented, "method SetLocalWorkerActual not implemented") 358 } 359 func (*UnimplementedNetworkControlServiceServer) WatchLocalWorkers(req *WatchOptions, srv NetworkControlService_WatchLocalWorkersServer) error { 360 return status.Errorf(codes.Unimplemented, "method WatchLocalWorkers not implemented") 361 } 362 func (*UnimplementedNetworkControlServiceServer) SetDeviceDiscoveryActual(ctx context.Context, req *DeviceDiscovery) (*Empty, error) { 363 return nil, status.Errorf(codes.Unimplemented, "method SetDeviceDiscoveryActual not implemented") 364 } 365 func (*UnimplementedNetworkControlServiceServer) SetPowerActual(ctx context.Context, req *PowerState) (*Empty, error) { 366 return nil, status.Errorf(codes.Unimplemented, "method SetPowerActual not implemented") 367 } 368 func (*UnimplementedNetworkControlServiceServer) SetLocActual(ctx context.Context, req *Loc) (*Empty, error) { 369 return nil, status.Errorf(codes.Unimplemented, "method SetLocActual not implemented") 370 } 371 func (*UnimplementedNetworkControlServiceServer) SetSensorActual(ctx context.Context, req *Sensor) (*Empty, error) { 372 return nil, status.Errorf(codes.Unimplemented, "method SetSensorActual not implemented") 373 } 374 func (*UnimplementedNetworkControlServiceServer) SetOutputActual(ctx context.Context, req *Output) (*Empty, error) { 375 return nil, status.Errorf(codes.Unimplemented, "method SetOutputActual not implemented") 376 } 377 func (*UnimplementedNetworkControlServiceServer) SetSwitchActual(ctx context.Context, req *Switch) (*Empty, error) { 378 return nil, status.Errorf(codes.Unimplemented, "method SetSwitchActual not implemented") 379 } 380 func (*UnimplementedNetworkControlServiceServer) SetClockActual(ctx context.Context, req *Clock) (*Empty, error) { 381 return nil, status.Errorf(codes.Unimplemented, "method SetClockActual not implemented") 382 } 383 func (*UnimplementedNetworkControlServiceServer) WatchClock(req *WatchOptions, srv NetworkControlService_WatchClockServer) error { 384 return status.Errorf(codes.Unimplemented, "method WatchClock not implemented") 385 } 386 387 func RegisterNetworkControlServiceServer(s *grpc.Server, srv NetworkControlServiceServer) { 388 s.RegisterService(&_NetworkControlService_serviceDesc, srv) 389 } 390 391 func _NetworkControlService_SetLocalWorkerRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 392 in := new(LocalWorker) 393 if err := dec(in); err != nil { 394 return nil, err 395 } 396 if interceptor == nil { 397 return srv.(NetworkControlServiceServer).SetLocalWorkerRequest(ctx, in) 398 } 399 info := &grpc.UnaryServerInfo{ 400 Server: srv, 401 FullMethod: "/binkynet.v1.NetworkControlService/SetLocalWorkerRequest", 402 } 403 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 404 return srv.(NetworkControlServiceServer).SetLocalWorkerRequest(ctx, req.(*LocalWorker)) 405 } 406 return interceptor(ctx, in, info, handler) 407 } 408 409 func _NetworkControlService_SetLocalWorkerActual_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 410 in := new(LocalWorker) 411 if err := dec(in); err != nil { 412 return nil, err 413 } 414 if interceptor == nil { 415 return srv.(NetworkControlServiceServer).SetLocalWorkerActual(ctx, in) 416 } 417 info := &grpc.UnaryServerInfo{ 418 Server: srv, 419 FullMethod: "/binkynet.v1.NetworkControlService/SetLocalWorkerActual", 420 } 421 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 422 return srv.(NetworkControlServiceServer).SetLocalWorkerActual(ctx, req.(*LocalWorker)) 423 } 424 return interceptor(ctx, in, info, handler) 425 } 426 427 func _NetworkControlService_WatchLocalWorkers_Handler(srv interface{}, stream grpc.ServerStream) error { 428 m := new(WatchOptions) 429 if err := stream.RecvMsg(m); err != nil { 430 return err 431 } 432 return srv.(NetworkControlServiceServer).WatchLocalWorkers(m, &networkControlServiceWatchLocalWorkersServer{stream}) 433 } 434 435 type NetworkControlService_WatchLocalWorkersServer interface { 436 Send(*LocalWorker) error 437 grpc.ServerStream 438 } 439 440 type networkControlServiceWatchLocalWorkersServer struct { 441 grpc.ServerStream 442 } 443 444 func (x *networkControlServiceWatchLocalWorkersServer) Send(m *LocalWorker) error { 445 return x.ServerStream.SendMsg(m) 446 } 447 448 func _NetworkControlService_SetDeviceDiscoveryActual_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 449 in := new(DeviceDiscovery) 450 if err := dec(in); err != nil { 451 return nil, err 452 } 453 if interceptor == nil { 454 return srv.(NetworkControlServiceServer).SetDeviceDiscoveryActual(ctx, in) 455 } 456 info := &grpc.UnaryServerInfo{ 457 Server: srv, 458 FullMethod: "/binkynet.v1.NetworkControlService/SetDeviceDiscoveryActual", 459 } 460 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 461 return srv.(NetworkControlServiceServer).SetDeviceDiscoveryActual(ctx, req.(*DeviceDiscovery)) 462 } 463 return interceptor(ctx, in, info, handler) 464 } 465 466 func _NetworkControlService_SetPowerActual_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 467 in := new(PowerState) 468 if err := dec(in); err != nil { 469 return nil, err 470 } 471 if interceptor == nil { 472 return srv.(NetworkControlServiceServer).SetPowerActual(ctx, in) 473 } 474 info := &grpc.UnaryServerInfo{ 475 Server: srv, 476 FullMethod: "/binkynet.v1.NetworkControlService/SetPowerActual", 477 } 478 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 479 return srv.(NetworkControlServiceServer).SetPowerActual(ctx, req.(*PowerState)) 480 } 481 return interceptor(ctx, in, info, handler) 482 } 483 484 func _NetworkControlService_SetLocActual_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 485 in := new(Loc) 486 if err := dec(in); err != nil { 487 return nil, err 488 } 489 if interceptor == nil { 490 return srv.(NetworkControlServiceServer).SetLocActual(ctx, in) 491 } 492 info := &grpc.UnaryServerInfo{ 493 Server: srv, 494 FullMethod: "/binkynet.v1.NetworkControlService/SetLocActual", 495 } 496 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 497 return srv.(NetworkControlServiceServer).SetLocActual(ctx, req.(*Loc)) 498 } 499 return interceptor(ctx, in, info, handler) 500 } 501 502 func _NetworkControlService_SetSensorActual_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 503 in := new(Sensor) 504 if err := dec(in); err != nil { 505 return nil, err 506 } 507 if interceptor == nil { 508 return srv.(NetworkControlServiceServer).SetSensorActual(ctx, in) 509 } 510 info := &grpc.UnaryServerInfo{ 511 Server: srv, 512 FullMethod: "/binkynet.v1.NetworkControlService/SetSensorActual", 513 } 514 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 515 return srv.(NetworkControlServiceServer).SetSensorActual(ctx, req.(*Sensor)) 516 } 517 return interceptor(ctx, in, info, handler) 518 } 519 520 func _NetworkControlService_SetOutputActual_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 521 in := new(Output) 522 if err := dec(in); err != nil { 523 return nil, err 524 } 525 if interceptor == nil { 526 return srv.(NetworkControlServiceServer).SetOutputActual(ctx, in) 527 } 528 info := &grpc.UnaryServerInfo{ 529 Server: srv, 530 FullMethod: "/binkynet.v1.NetworkControlService/SetOutputActual", 531 } 532 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 533 return srv.(NetworkControlServiceServer).SetOutputActual(ctx, req.(*Output)) 534 } 535 return interceptor(ctx, in, info, handler) 536 } 537 538 func _NetworkControlService_SetSwitchActual_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 539 in := new(Switch) 540 if err := dec(in); err != nil { 541 return nil, err 542 } 543 if interceptor == nil { 544 return srv.(NetworkControlServiceServer).SetSwitchActual(ctx, in) 545 } 546 info := &grpc.UnaryServerInfo{ 547 Server: srv, 548 FullMethod: "/binkynet.v1.NetworkControlService/SetSwitchActual", 549 } 550 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 551 return srv.(NetworkControlServiceServer).SetSwitchActual(ctx, req.(*Switch)) 552 } 553 return interceptor(ctx, in, info, handler) 554 } 555 556 func _NetworkControlService_SetClockActual_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 557 in := new(Clock) 558 if err := dec(in); err != nil { 559 return nil, err 560 } 561 if interceptor == nil { 562 return srv.(NetworkControlServiceServer).SetClockActual(ctx, in) 563 } 564 info := &grpc.UnaryServerInfo{ 565 Server: srv, 566 FullMethod: "/binkynet.v1.NetworkControlService/SetClockActual", 567 } 568 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 569 return srv.(NetworkControlServiceServer).SetClockActual(ctx, req.(*Clock)) 570 } 571 return interceptor(ctx, in, info, handler) 572 } 573 574 func _NetworkControlService_WatchClock_Handler(srv interface{}, stream grpc.ServerStream) error { 575 m := new(WatchOptions) 576 if err := stream.RecvMsg(m); err != nil { 577 return err 578 } 579 return srv.(NetworkControlServiceServer).WatchClock(m, &networkControlServiceWatchClockServer{stream}) 580 } 581 582 type NetworkControlService_WatchClockServer interface { 583 Send(*Clock) error 584 grpc.ServerStream 585 } 586 587 type networkControlServiceWatchClockServer struct { 588 grpc.ServerStream 589 } 590 591 func (x *networkControlServiceWatchClockServer) Send(m *Clock) error { 592 return x.ServerStream.SendMsg(m) 593 } 594 595 var _NetworkControlService_serviceDesc = grpc.ServiceDesc{ 596 ServiceName: "binkynet.v1.NetworkControlService", 597 HandlerType: (*NetworkControlServiceServer)(nil), 598 Methods: []grpc.MethodDesc{ 599 { 600 MethodName: "SetLocalWorkerRequest", 601 Handler: _NetworkControlService_SetLocalWorkerRequest_Handler, 602 }, 603 { 604 MethodName: "SetLocalWorkerActual", 605 Handler: _NetworkControlService_SetLocalWorkerActual_Handler, 606 }, 607 { 608 MethodName: "SetDeviceDiscoveryActual", 609 Handler: _NetworkControlService_SetDeviceDiscoveryActual_Handler, 610 }, 611 { 612 MethodName: "SetPowerActual", 613 Handler: _NetworkControlService_SetPowerActual_Handler, 614 }, 615 { 616 MethodName: "SetLocActual", 617 Handler: _NetworkControlService_SetLocActual_Handler, 618 }, 619 { 620 MethodName: "SetSensorActual", 621 Handler: _NetworkControlService_SetSensorActual_Handler, 622 }, 623 { 624 MethodName: "SetOutputActual", 625 Handler: _NetworkControlService_SetOutputActual_Handler, 626 }, 627 { 628 MethodName: "SetSwitchActual", 629 Handler: _NetworkControlService_SetSwitchActual_Handler, 630 }, 631 { 632 MethodName: "SetClockActual", 633 Handler: _NetworkControlService_SetClockActual_Handler, 634 }, 635 }, 636 Streams: []grpc.StreamDesc{ 637 { 638 StreamName: "WatchLocalWorkers", 639 Handler: _NetworkControlService_WatchLocalWorkers_Handler, 640 ServerStreams: true, 641 }, 642 { 643 StreamName: "WatchClock", 644 Handler: _NetworkControlService_WatchClock_Handler, 645 ServerStreams: true, 646 }, 647 }, 648 Metadata: "network.proto", 649 } 650 651 func (m *WatchOptions) Marshal() (dAtA []byte, err error) { 652 size := m.Size() 653 dAtA = make([]byte, size) 654 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 655 if err != nil { 656 return nil, err 657 } 658 return dAtA[:n], nil 659 } 660 661 func (m *WatchOptions) MarshalTo(dAtA []byte) (int, error) { 662 size := m.Size() 663 return m.MarshalToSizedBuffer(dAtA[:size]) 664 } 665 666 func (m *WatchOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { 667 i := len(dAtA) 668 _ = i 669 var l int 670 _ = l 671 if m.XXX_unrecognized != nil { 672 i -= len(m.XXX_unrecognized) 673 copy(dAtA[i:], m.XXX_unrecognized) 674 } 675 if len(m.ModuleId) > 0 { 676 i -= len(m.ModuleId) 677 copy(dAtA[i:], m.ModuleId) 678 i = encodeVarintNetwork(dAtA, i, uint64(len(m.ModuleId))) 679 i-- 680 dAtA[i] = 0x1a 681 } 682 if m.WatchActualChanges { 683 i-- 684 if m.WatchActualChanges { 685 dAtA[i] = 1 686 } else { 687 dAtA[i] = 0 688 } 689 i-- 690 dAtA[i] = 0x10 691 } 692 if m.WatchRequestChanges { 693 i-- 694 if m.WatchRequestChanges { 695 dAtA[i] = 1 696 } else { 697 dAtA[i] = 0 698 } 699 i-- 700 dAtA[i] = 0x8 701 } 702 return len(dAtA) - i, nil 703 } 704 705 func encodeVarintNetwork(dAtA []byte, offset int, v uint64) int { 706 offset -= sovNetwork(v) 707 base := offset 708 for v >= 1<<7 { 709 dAtA[offset] = uint8(v&0x7f | 0x80) 710 v >>= 7 711 offset++ 712 } 713 dAtA[offset] = uint8(v) 714 return base 715 } 716 func (m *WatchOptions) Size() (n int) { 717 if m == nil { 718 return 0 719 } 720 var l int 721 _ = l 722 if m.WatchRequestChanges { 723 n += 2 724 } 725 if m.WatchActualChanges { 726 n += 2 727 } 728 l = len(m.ModuleId) 729 if l > 0 { 730 n += 1 + l + sovNetwork(uint64(l)) 731 } 732 if m.XXX_unrecognized != nil { 733 n += len(m.XXX_unrecognized) 734 } 735 return n 736 } 737 738 func sovNetwork(x uint64) (n int) { 739 return (math_bits.Len64(x|1) + 6) / 7 740 } 741 func sozNetwork(x uint64) (n int) { 742 return sovNetwork(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 743 } 744 func (m *WatchOptions) Unmarshal(dAtA []byte) error { 745 l := len(dAtA) 746 iNdEx := 0 747 for iNdEx < l { 748 preIndex := iNdEx 749 var wire uint64 750 for shift := uint(0); ; shift += 7 { 751 if shift >= 64 { 752 return ErrIntOverflowNetwork 753 } 754 if iNdEx >= l { 755 return io.ErrUnexpectedEOF 756 } 757 b := dAtA[iNdEx] 758 iNdEx++ 759 wire |= uint64(b&0x7F) << shift 760 if b < 0x80 { 761 break 762 } 763 } 764 fieldNum := int32(wire >> 3) 765 wireType := int(wire & 0x7) 766 if wireType == 4 { 767 return fmt.Errorf("proto: WatchOptions: wiretype end group for non-group") 768 } 769 if fieldNum <= 0 { 770 return fmt.Errorf("proto: WatchOptions: illegal tag %d (wire type %d)", fieldNum, wire) 771 } 772 switch fieldNum { 773 case 1: 774 if wireType != 0 { 775 return fmt.Errorf("proto: wrong wireType = %d for field WatchRequestChanges", wireType) 776 } 777 var v int 778 for shift := uint(0); ; shift += 7 { 779 if shift >= 64 { 780 return ErrIntOverflowNetwork 781 } 782 if iNdEx >= l { 783 return io.ErrUnexpectedEOF 784 } 785 b := dAtA[iNdEx] 786 iNdEx++ 787 v |= int(b&0x7F) << shift 788 if b < 0x80 { 789 break 790 } 791 } 792 m.WatchRequestChanges = bool(v != 0) 793 case 2: 794 if wireType != 0 { 795 return fmt.Errorf("proto: wrong wireType = %d for field WatchActualChanges", wireType) 796 } 797 var v int 798 for shift := uint(0); ; shift += 7 { 799 if shift >= 64 { 800 return ErrIntOverflowNetwork 801 } 802 if iNdEx >= l { 803 return io.ErrUnexpectedEOF 804 } 805 b := dAtA[iNdEx] 806 iNdEx++ 807 v |= int(b&0x7F) << shift 808 if b < 0x80 { 809 break 810 } 811 } 812 m.WatchActualChanges = bool(v != 0) 813 case 3: 814 if wireType != 2 { 815 return fmt.Errorf("proto: wrong wireType = %d for field ModuleId", wireType) 816 } 817 var stringLen uint64 818 for shift := uint(0); ; shift += 7 { 819 if shift >= 64 { 820 return ErrIntOverflowNetwork 821 } 822 if iNdEx >= l { 823 return io.ErrUnexpectedEOF 824 } 825 b := dAtA[iNdEx] 826 iNdEx++ 827 stringLen |= uint64(b&0x7F) << shift 828 if b < 0x80 { 829 break 830 } 831 } 832 intStringLen := int(stringLen) 833 if intStringLen < 0 { 834 return ErrInvalidLengthNetwork 835 } 836 postIndex := iNdEx + intStringLen 837 if postIndex < 0 { 838 return ErrInvalidLengthNetwork 839 } 840 if postIndex > l { 841 return io.ErrUnexpectedEOF 842 } 843 m.ModuleId = string(dAtA[iNdEx:postIndex]) 844 iNdEx = postIndex 845 default: 846 iNdEx = preIndex 847 skippy, err := skipNetwork(dAtA[iNdEx:]) 848 if err != nil { 849 return err 850 } 851 if (skippy < 0) || (iNdEx+skippy) < 0 { 852 return ErrInvalidLengthNetwork 853 } 854 if (iNdEx + skippy) > l { 855 return io.ErrUnexpectedEOF 856 } 857 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 858 iNdEx += skippy 859 } 860 } 861 862 if iNdEx > l { 863 return io.ErrUnexpectedEOF 864 } 865 return nil 866 } 867 func skipNetwork(dAtA []byte) (n int, err error) { 868 l := len(dAtA) 869 iNdEx := 0 870 depth := 0 871 for iNdEx < l { 872 var wire uint64 873 for shift := uint(0); ; shift += 7 { 874 if shift >= 64 { 875 return 0, ErrIntOverflowNetwork 876 } 877 if iNdEx >= l { 878 return 0, io.ErrUnexpectedEOF 879 } 880 b := dAtA[iNdEx] 881 iNdEx++ 882 wire |= (uint64(b) & 0x7F) << shift 883 if b < 0x80 { 884 break 885 } 886 } 887 wireType := int(wire & 0x7) 888 switch wireType { 889 case 0: 890 for shift := uint(0); ; shift += 7 { 891 if shift >= 64 { 892 return 0, ErrIntOverflowNetwork 893 } 894 if iNdEx >= l { 895 return 0, io.ErrUnexpectedEOF 896 } 897 iNdEx++ 898 if dAtA[iNdEx-1] < 0x80 { 899 break 900 } 901 } 902 case 1: 903 iNdEx += 8 904 case 2: 905 var length int 906 for shift := uint(0); ; shift += 7 { 907 if shift >= 64 { 908 return 0, ErrIntOverflowNetwork 909 } 910 if iNdEx >= l { 911 return 0, io.ErrUnexpectedEOF 912 } 913 b := dAtA[iNdEx] 914 iNdEx++ 915 length |= (int(b) & 0x7F) << shift 916 if b < 0x80 { 917 break 918 } 919 } 920 if length < 0 { 921 return 0, ErrInvalidLengthNetwork 922 } 923 iNdEx += length 924 case 3: 925 depth++ 926 case 4: 927 if depth == 0 { 928 return 0, ErrUnexpectedEndOfGroupNetwork 929 } 930 depth-- 931 case 5: 932 iNdEx += 4 933 default: 934 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 935 } 936 if iNdEx < 0 { 937 return 0, ErrInvalidLengthNetwork 938 } 939 if depth == 0 { 940 return iNdEx, nil 941 } 942 } 943 return 0, io.ErrUnexpectedEOF 944 } 945 946 var ( 947 ErrInvalidLengthNetwork = fmt.Errorf("proto: negative length found during unmarshaling") 948 ErrIntOverflowNetwork = fmt.Errorf("proto: integer overflow") 949 ErrUnexpectedEndOfGroupNetwork = fmt.Errorf("proto: unexpected end of group") 950 )