fixed system state tracking. Working TUI w/ reactor list, adding device pages next

main
KeeganForelight 2 years ago
parent 1692cbe748
commit 9dacb2d007

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -20,16 +20,17 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type GetReactorsRequest struct {
type GetDevicesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ClientId uint32 `protobuf:"varint,1,opt,name=clientId,proto3" json:"clientId,omitempty"`
ClientId uint32 `protobuf:"varint,1,opt,name=clientId,proto3" json:"clientId,omitempty"`
ReactorId uint32 `protobuf:"varint,2,opt,name=reactorId,proto3" json:"reactorId,omitempty"` // if unspecified, don't return any devs
}
func (x *GetReactorsRequest) Reset() {
*x = GetReactorsRequest{}
func (x *GetDevicesRequest) Reset() {
*x = GetDevicesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -37,13 +38,13 @@ func (x *GetReactorsRequest) Reset() {
}
}
func (x *GetReactorsRequest) String() string {
func (x *GetDevicesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetReactorsRequest) ProtoMessage() {}
func (*GetDevicesRequest) ProtoMessage() {}
func (x *GetReactorsRequest) ProtoReflect() protoreflect.Message {
func (x *GetDevicesRequest) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -55,129 +56,26 @@ func (x *GetReactorsRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use GetReactorsRequest.ProtoReflect.Descriptor instead.
func (*GetReactorsRequest) Descriptor() ([]byte, []int) {
// Deprecated: Use GetDevicesRequest.ProtoReflect.Descriptor instead.
func (*GetDevicesRequest) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{0}
}
func (x *GetReactorsRequest) GetClientId() uint32 {
if x != nil {
return x.ClientId
}
return 0
}
type GetReactorsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ClientId uint32 `protobuf:"varint,1,opt,name=clientId,proto3" json:"clientId,omitempty"`
Reactors []*Reactor `protobuf:"bytes,2,rep,name=reactors,proto3" json:"reactors,omitempty"`
}
func (x *GetReactorsResponse) Reset() {
*x = GetReactorsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetReactorsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetReactorsResponse) ProtoMessage() {}
func (x *GetReactorsResponse) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetReactorsResponse.ProtoReflect.Descriptor instead.
func (*GetReactorsResponse) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{1}
}
func (x *GetReactorsResponse) GetClientId() uint32 {
if x != nil {
return x.ClientId
}
return 0
}
func (x *GetReactorsResponse) GetReactors() []*Reactor {
if x != nil {
return x.Reactors
}
return nil
}
type GetReactorDevicesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ClientId uint32 `protobuf:"varint,1,opt,name=clientId,proto3" json:"clientId,omitempty"`
ReactorId uint32 `protobuf:"varint,2,opt,name=reactorId,proto3" json:"reactorId,omitempty"`
}
func (x *GetReactorDevicesRequest) Reset() {
*x = GetReactorDevicesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetReactorDevicesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetReactorDevicesRequest) ProtoMessage() {}
func (x *GetReactorDevicesRequest) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetReactorDevicesRequest.ProtoReflect.Descriptor instead.
func (*GetReactorDevicesRequest) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{2}
}
func (x *GetReactorDevicesRequest) GetClientId() uint32 {
func (x *GetDevicesRequest) GetClientId() uint32 {
if x != nil {
return x.ClientId
}
return 0
}
func (x *GetReactorDevicesRequest) GetReactorId() uint32 {
func (x *GetDevicesRequest) GetReactorId() uint32 {
if x != nil {
return x.ReactorId
}
return 0
}
type GetReactorDevicesResponse struct {
type GetDevicesResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -187,23 +85,23 @@ type GetReactorDevicesResponse struct {
Devices []*Dev `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"`
}
func (x *GetReactorDevicesResponse) Reset() {
*x = GetReactorDevicesResponse{}
func (x *GetDevicesResponse) Reset() {
*x = GetDevicesResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[3]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetReactorDevicesResponse) String() string {
func (x *GetDevicesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetReactorDevicesResponse) ProtoMessage() {}
func (*GetDevicesResponse) ProtoMessage() {}
func (x *GetReactorDevicesResponse) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[3]
func (x *GetDevicesResponse) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -214,26 +112,26 @@ func (x *GetReactorDevicesResponse) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use GetReactorDevicesResponse.ProtoReflect.Descriptor instead.
func (*GetReactorDevicesResponse) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{3}
// Deprecated: Use GetDevicesResponse.ProtoReflect.Descriptor instead.
func (*GetDevicesResponse) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{1}
}
func (x *GetReactorDevicesResponse) GetClientId() uint32 {
func (x *GetDevicesResponse) GetClientId() uint32 {
if x != nil {
return x.ClientId
}
return 0
}
func (x *GetReactorDevicesResponse) GetReactorId() uint32 {
func (x *GetDevicesResponse) GetReactorId() uint32 {
if x != nil {
return x.ReactorId
}
return 0
}
func (x *GetReactorDevicesResponse) GetDevices() []*Dev {
func (x *GetDevicesResponse) GetDevices() []*Dev {
if x != nil {
return x.Devices
}
@ -252,7 +150,7 @@ type DeleteReactorRequest struct {
func (x *DeleteReactorRequest) Reset() {
*x = DeleteReactorRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[4]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -265,7 +163,7 @@ func (x *DeleteReactorRequest) String() string {
func (*DeleteReactorRequest) ProtoMessage() {}
func (x *DeleteReactorRequest) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[4]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -278,7 +176,7 @@ func (x *DeleteReactorRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteReactorRequest.ProtoReflect.Descriptor instead.
func (*DeleteReactorRequest) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{4}
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{2}
}
func (x *DeleteReactorRequest) GetClientId() uint32 {
@ -308,7 +206,7 @@ type DeleteReactorResponse struct {
func (x *DeleteReactorResponse) Reset() {
*x = DeleteReactorResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[5]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -321,7 +219,7 @@ func (x *DeleteReactorResponse) String() string {
func (*DeleteReactorResponse) ProtoMessage() {}
func (x *DeleteReactorResponse) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[5]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -334,7 +232,7 @@ func (x *DeleteReactorResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteReactorResponse.ProtoReflect.Descriptor instead.
func (*DeleteReactorResponse) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{5}
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{3}
}
func (x *DeleteReactorResponse) GetClientId() uint32 {
@ -371,7 +269,7 @@ type DeleteReactorDeviceRequest struct {
func (x *DeleteReactorDeviceRequest) Reset() {
*x = DeleteReactorDeviceRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[6]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -384,7 +282,7 @@ func (x *DeleteReactorDeviceRequest) String() string {
func (*DeleteReactorDeviceRequest) ProtoMessage() {}
func (x *DeleteReactorDeviceRequest) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[6]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -397,7 +295,7 @@ func (x *DeleteReactorDeviceRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteReactorDeviceRequest.ProtoReflect.Descriptor instead.
func (*DeleteReactorDeviceRequest) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{6}
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{4}
}
func (x *DeleteReactorDeviceRequest) GetClientId() uint32 {
@ -435,7 +333,7 @@ type DeleteReactorDeviceResponse struct {
func (x *DeleteReactorDeviceResponse) Reset() {
*x = DeleteReactorDeviceResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[7]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -448,7 +346,7 @@ func (x *DeleteReactorDeviceResponse) String() string {
func (*DeleteReactorDeviceResponse) ProtoMessage() {}
func (x *DeleteReactorDeviceResponse) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[7]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -461,7 +359,7 @@ func (x *DeleteReactorDeviceResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteReactorDeviceResponse.ProtoReflect.Descriptor instead.
func (*DeleteReactorDeviceResponse) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{7}
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{5}
}
func (x *DeleteReactorDeviceResponse) GetClientId() uint32 {
@ -492,76 +390,22 @@ func (x *DeleteReactorDeviceResponse) GetSuccess() bool {
return false
}
type Reactor struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Status bool `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
}
func (x *Reactor) Reset() {
*x = Reactor{}
if protoimpl.UnsafeEnabled {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Reactor) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Reactor) ProtoMessage() {}
func (x *Reactor) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Reactor.ProtoReflect.Descriptor instead.
func (*Reactor) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{8}
}
func (x *Reactor) GetId() uint32 {
if x != nil {
return x.Id
}
return 0
}
func (x *Reactor) GetStatus() bool {
if x != nil {
return x.Status
}
return false
}
type Dev struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Addr int32 `protobuf:"varint,1,opt,name=addr,proto3" json:"addr,omitempty"`
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
Data string `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // either reactor id or dev addr
Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // ["reactor","__ sensor",...]
Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` // set by RLC/SM
Data string `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` // set by RLC/SM
Index uint32 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` // set by infostream to keep consistency
}
func (x *Dev) Reset() {
*x = Dev{}
if protoimpl.UnsafeEnabled {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[9]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -574,7 +418,7 @@ func (x *Dev) String() string {
func (*Dev) ProtoMessage() {}
func (x *Dev) ProtoReflect() protoreflect.Message {
mi := &file_internal_pkg_grpc_management_proto_msgTypes[9]
mi := &file_internal_pkg_grpc_management_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -587,12 +431,12 @@ func (x *Dev) ProtoReflect() protoreflect.Message {
// Deprecated: Use Dev.ProtoReflect.Descriptor instead.
func (*Dev) Descriptor() ([]byte, []int) {
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{9}
return file_internal_pkg_grpc_management_proto_rawDescGZIP(), []int{6}
}
func (x *Dev) GetAddr() int32 {
func (x *Dev) GetId() uint32 {
if x != nil {
return x.Addr
return x.Id
}
return 0
}
@ -618,94 +462,83 @@ func (x *Dev) GetData() string {
return ""
}
func (x *Dev) GetIndex() uint32 {
if x != nil {
return x.Index
}
return 0
}
var File_internal_pkg_grpc_management_proto protoreflect.FileDescriptor
var file_internal_pkg_grpc_management_proto_rawDesc = []byte{
0x0a, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67,
0x72, 0x70, 0x63, 0x2f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x22, 0x30, 0x0a, 0x12, 0x47, 0x65,
0x74, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0d, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x5c, 0x0a, 0x13,
0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12,
0x29, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x0d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72,
0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x54, 0x0a, 0x18, 0x47, 0x65,
0x74, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x67, 0x72, 0x70, 0x63, 0x22, 0x4d, 0x0a, 0x11, 0x47, 0x65,
0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0d, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72,
0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09,
0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x73, 0x0a, 0x12, 0x47, 0x65, 0x74,
0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0d, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72,
0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09,
0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x07, 0x64, 0x65, 0x76,
0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x67, 0x72, 0x70,
0x63, 0x2e, 0x44, 0x65, 0x76, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x50,
0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64,
0x22, 0x7a, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x65,
0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a,
0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61,
0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65,
0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63,
0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e,
0x44, 0x65, 0x76, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x50, 0x0a, 0x14,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64,
0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x6b,
0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e,
0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49,
0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01,
0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x70, 0x0a, 0x1a, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x76, 0x69,
0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69,
0x22, 0x6b, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f,
0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69,
0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x63, 0x6c, 0x69,
0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72,
0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x6f,
0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, 0x18, 0x03,
0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, 0x22, 0x8b, 0x01,
0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x44,
0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a,
0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61,
0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65,
0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x41, 0x64,
0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x65, 0x76, 0x41, 0x64, 0x64,
0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01,
0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x31, 0x0a, 0x07, 0x52,
0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x59,
0x0a, 0x03, 0x44, 0x65, 0x76, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73,
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0xcc, 0x02, 0x0a, 0x0a, 0x6d, 0x61,
0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52,
0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47,
0x65, 0x74, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x19, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x63,
0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, 0x0a, 0x11,
0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65,
0x73, 0x12, 0x1e, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x63,
0x74, 0x6f, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x1f, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x63,
0x74, 0x6f, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x48, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63,
0x74, 0x6f, 0x72, 0x12, 0x1a, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61,
0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x13,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x76,
0x69, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x13, 0x5a, 0x11, 0x69, 0x6e, 0x74, 0x65,
0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x03,
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x70, 0x0a,
0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x65,
0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63,
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x63,
0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74,
0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63,
0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72,
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x65, 0x76, 0x41, 0x64, 0x64, 0x72, 0x22,
0x8b, 0x01, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f,
0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x1a, 0x0a, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0d, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72,
0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09,
0x72, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x76,
0x41, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x64, 0x65, 0x76, 0x41,
0x64, 0x64, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x04,
0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x6b, 0x0a,
0x03, 0x44, 0x65, 0x76, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74,
0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x32, 0xf3, 0x01, 0x0a, 0x0a, 0x6d,
0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74,
0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47,
0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x18, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63,
0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0d, 0x44, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x1a, 0x2e, 0x67, 0x72,
0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65,
0x61, 0x63, 0x74, 0x6f, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x67, 0x72,
0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74, 0x6f, 0x72,
0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e,
0x67, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x61, 0x63, 0x74,
0x6f, 0x72, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x42, 0x13, 0x5a, 0x11, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67,
0x2f, 0x67, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -720,35 +553,29 @@ func file_internal_pkg_grpc_management_proto_rawDescGZIP() []byte {
return file_internal_pkg_grpc_management_proto_rawDescData
}
var file_internal_pkg_grpc_management_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_internal_pkg_grpc_management_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_internal_pkg_grpc_management_proto_goTypes = []interface{}{
(*GetReactorsRequest)(nil), // 0: grpc.GetReactorsRequest
(*GetReactorsResponse)(nil), // 1: grpc.GetReactorsResponse
(*GetReactorDevicesRequest)(nil), // 2: grpc.GetReactorDevicesRequest
(*GetReactorDevicesResponse)(nil), // 3: grpc.GetReactorDevicesResponse
(*DeleteReactorRequest)(nil), // 4: grpc.DeleteReactorRequest
(*DeleteReactorResponse)(nil), // 5: grpc.DeleteReactorResponse
(*DeleteReactorDeviceRequest)(nil), // 6: grpc.DeleteReactorDeviceRequest
(*DeleteReactorDeviceResponse)(nil), // 7: grpc.DeleteReactorDeviceResponse
(*Reactor)(nil), // 8: grpc.Reactor
(*Dev)(nil), // 9: grpc.Dev
(*GetDevicesRequest)(nil), // 0: grpc.GetDevicesRequest
(*GetDevicesResponse)(nil), // 1: grpc.GetDevicesResponse
(*DeleteReactorRequest)(nil), // 2: grpc.DeleteReactorRequest
(*DeleteReactorResponse)(nil), // 3: grpc.DeleteReactorResponse
(*DeleteReactorDeviceRequest)(nil), // 4: grpc.DeleteReactorDeviceRequest
(*DeleteReactorDeviceResponse)(nil), // 5: grpc.DeleteReactorDeviceResponse
(*Dev)(nil), // 6: grpc.Dev
}
var file_internal_pkg_grpc_management_proto_depIdxs = []int32{
8, // 0: grpc.GetReactorsResponse.reactors:type_name -> grpc.Reactor
9, // 1: grpc.GetReactorDevicesResponse.devices:type_name -> grpc.Dev
0, // 2: grpc.management.GetReactors:input_type -> grpc.GetReactorsRequest
2, // 3: grpc.management.GetReactorDevices:input_type -> grpc.GetReactorDevicesRequest
4, // 4: grpc.management.DeleteReactor:input_type -> grpc.DeleteReactorRequest
6, // 5: grpc.management.DeleteReactorDevice:input_type -> grpc.DeleteReactorDeviceRequest
1, // 6: grpc.management.GetReactors:output_type -> grpc.GetReactorsResponse
3, // 7: grpc.management.GetReactorDevices:output_type -> grpc.GetReactorDevicesResponse
5, // 8: grpc.management.DeleteReactor:output_type -> grpc.DeleteReactorResponse
7, // 9: grpc.management.DeleteReactorDevice:output_type -> grpc.DeleteReactorDeviceResponse
6, // [6:10] is the sub-list for method output_type
2, // [2:6] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
6, // 0: grpc.GetDevicesResponse.devices:type_name -> grpc.Dev
0, // 1: grpc.management.GetDevices:input_type -> grpc.GetDevicesRequest
2, // 2: grpc.management.DeleteReactor:input_type -> grpc.DeleteReactorRequest
4, // 3: grpc.management.DeleteReactorDevice:input_type -> grpc.DeleteReactorDeviceRequest
1, // 4: grpc.management.GetDevices:output_type -> grpc.GetDevicesResponse
3, // 5: grpc.management.DeleteReactor:output_type -> grpc.DeleteReactorResponse
5, // 6: grpc.management.DeleteReactorDevice:output_type -> grpc.DeleteReactorDeviceResponse
4, // [4:7] is the sub-list for method output_type
1, // [1:4] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_internal_pkg_grpc_management_proto_init() }
@ -758,7 +585,7 @@ func file_internal_pkg_grpc_management_proto_init() {
}
if !protoimpl.UnsafeEnabled {
file_internal_pkg_grpc_management_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetReactorsRequest); i {
switch v := v.(*GetDevicesRequest); i {
case 0:
return &v.state
case 1:
@ -770,7 +597,7 @@ func file_internal_pkg_grpc_management_proto_init() {
}
}
file_internal_pkg_grpc_management_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetReactorsResponse); i {
switch v := v.(*GetDevicesResponse); i {
case 0:
return &v.state
case 1:
@ -782,30 +609,6 @@ func file_internal_pkg_grpc_management_proto_init() {
}
}
file_internal_pkg_grpc_management_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetReactorDevicesRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_internal_pkg_grpc_management_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetReactorDevicesResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_internal_pkg_grpc_management_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteReactorRequest); i {
case 0:
return &v.state
@ -817,7 +620,7 @@ func file_internal_pkg_grpc_management_proto_init() {
return nil
}
}
file_internal_pkg_grpc_management_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_internal_pkg_grpc_management_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteReactorResponse); i {
case 0:
return &v.state
@ -829,7 +632,7 @@ func file_internal_pkg_grpc_management_proto_init() {
return nil
}
}
file_internal_pkg_grpc_management_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_internal_pkg_grpc_management_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteReactorDeviceRequest); i {
case 0:
return &v.state
@ -841,7 +644,7 @@ func file_internal_pkg_grpc_management_proto_init() {
return nil
}
}
file_internal_pkg_grpc_management_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_internal_pkg_grpc_management_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeleteReactorDeviceResponse); i {
case 0:
return &v.state
@ -853,19 +656,7 @@ func file_internal_pkg_grpc_management_proto_init() {
return nil
}
}
file_internal_pkg_grpc_management_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Reactor); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_internal_pkg_grpc_management_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_internal_pkg_grpc_management_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Dev); i {
case 0:
return &v.state
@ -884,7 +675,7 @@ func file_internal_pkg_grpc_management_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_internal_pkg_grpc_management_proto_rawDesc,
NumEnums: 0,
NumMessages: 10,
NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},

@ -4,27 +4,17 @@ package grpc;
option go_package = "internal/pkg/grpc";
service management {
rpc GetReactors(GetReactorsRequest) returns (GetReactorsResponse);
rpc GetReactorDevices(GetReactorDevicesRequest) returns (GetReactorDevicesResponse);
rpc GetDevices(GetDevicesRequest) returns (GetDevicesResponse);
rpc DeleteReactor(DeleteReactorRequest) returns (DeleteReactorResponse);
rpc DeleteReactorDevice(DeleteReactorDeviceRequest) returns (DeleteReactorDeviceResponse);
}
message GetReactorsRequest {
message GetDevicesRequest {
uint32 clientId = 1;
uint32 reactorId = 2; // if unspecified, don't return any devs
}
message GetReactorsResponse {
uint32 clientId = 1;
repeated Reactor reactors = 2;
}
message GetReactorDevicesRequest {
uint32 clientId = 1;
uint32 reactorId = 2;
}
message GetReactorDevicesResponse {
message GetDevicesResponse {
uint32 clientId = 1;
uint32 reactorId = 2;
repeated Dev devices = 3;
@ -54,14 +44,10 @@ message DeleteReactorDeviceResponse {
bool success = 4;
}
message Reactor {
uint32 id = 1;
bool status = 2;
}
message Dev {
int32 addr = 1;
string type = 2;
string status = 3;
string data = 4;
uint32 id = 1; // either reactor id or dev addr
string type = 2; // ["reactor","__ sensor",...]
string status = 3; // set by RLC/SM
string data = 4; // set by RLC/SM
uint32 index = 5; // set by infostream to keep consistency
}

@ -22,8 +22,7 @@ const _ = grpc.SupportPackageIsVersion7
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ManagementClient interface {
GetReactors(ctx context.Context, in *GetReactorsRequest, opts ...grpc.CallOption) (*GetReactorsResponse, error)
GetReactorDevices(ctx context.Context, in *GetReactorDevicesRequest, opts ...grpc.CallOption) (*GetReactorDevicesResponse, error)
GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (*GetDevicesResponse, error)
DeleteReactor(ctx context.Context, in *DeleteReactorRequest, opts ...grpc.CallOption) (*DeleteReactorResponse, error)
DeleteReactorDevice(ctx context.Context, in *DeleteReactorDeviceRequest, opts ...grpc.CallOption) (*DeleteReactorDeviceResponse, error)
}
@ -36,18 +35,9 @@ func NewManagementClient(cc grpc.ClientConnInterface) ManagementClient {
return &managementClient{cc}
}
func (c *managementClient) GetReactors(ctx context.Context, in *GetReactorsRequest, opts ...grpc.CallOption) (*GetReactorsResponse, error) {
out := new(GetReactorsResponse)
err := c.cc.Invoke(ctx, "/grpc.management/GetReactors", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *managementClient) GetReactorDevices(ctx context.Context, in *GetReactorDevicesRequest, opts ...grpc.CallOption) (*GetReactorDevicesResponse, error) {
out := new(GetReactorDevicesResponse)
err := c.cc.Invoke(ctx, "/grpc.management/GetReactorDevices", in, out, opts...)
func (c *managementClient) GetDevices(ctx context.Context, in *GetDevicesRequest, opts ...grpc.CallOption) (*GetDevicesResponse, error) {
out := new(GetDevicesResponse)
err := c.cc.Invoke(ctx, "/grpc.management/GetDevices", in, out, opts...)
if err != nil {
return nil, err
}
@ -76,8 +66,7 @@ func (c *managementClient) DeleteReactorDevice(ctx context.Context, in *DeleteRe
// All implementations must embed UnimplementedManagementServer
// for forward compatibility
type ManagementServer interface {
GetReactors(context.Context, *GetReactorsRequest) (*GetReactorsResponse, error)
GetReactorDevices(context.Context, *GetReactorDevicesRequest) (*GetReactorDevicesResponse, error)
GetDevices(context.Context, *GetDevicesRequest) (*GetDevicesResponse, error)
DeleteReactor(context.Context, *DeleteReactorRequest) (*DeleteReactorResponse, error)
DeleteReactorDevice(context.Context, *DeleteReactorDeviceRequest) (*DeleteReactorDeviceResponse, error)
mustEmbedUnimplementedManagementServer()
@ -87,11 +76,8 @@ type ManagementServer interface {
type UnimplementedManagementServer struct {
}
func (UnimplementedManagementServer) GetReactors(context.Context, *GetReactorsRequest) (*GetReactorsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetReactors not implemented")
}
func (UnimplementedManagementServer) GetReactorDevices(context.Context, *GetReactorDevicesRequest) (*GetReactorDevicesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetReactorDevices not implemented")
func (UnimplementedManagementServer) GetDevices(context.Context, *GetDevicesRequest) (*GetDevicesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDevices not implemented")
}
func (UnimplementedManagementServer) DeleteReactor(context.Context, *DeleteReactorRequest) (*DeleteReactorResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteReactor not implemented")
@ -112,38 +98,20 @@ func RegisterManagementServer(s grpc.ServiceRegistrar, srv ManagementServer) {
s.RegisterService(&Management_ServiceDesc, srv)
}
func _Management_GetReactors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetReactorsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagementServer).GetReactors(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.management/GetReactors",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagementServer).GetReactors(ctx, req.(*GetReactorsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Management_GetReactorDevices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetReactorDevicesRequest)
func _Management_GetDevices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetDevicesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ManagementServer).GetReactorDevices(ctx, in)
return srv.(ManagementServer).GetDevices(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/grpc.management/GetReactorDevices",
FullMethod: "/grpc.management/GetDevices",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ManagementServer).GetReactorDevices(ctx, req.(*GetReactorDevicesRequest))
return srv.(ManagementServer).GetDevices(ctx, req.(*GetDevicesRequest))
}
return interceptor(ctx, in, info, handler)
}
@ -192,12 +160,8 @@ var Management_ServiceDesc = grpc.ServiceDesc{
HandlerType: (*ManagementServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetReactors",
Handler: _Management_GetReactors_Handler,
},
{
MethodName: "GetReactorDevices",
Handler: _Management_GetReactorDevices_Handler,
MethodName: "GetDevices",
Handler: _Management_GetDevices_Handler,
},
{
MethodName: "DeleteReactor",

@ -0,0 +1,240 @@
package server
import (
"sync"
_ "fmt"
)
// package will create and maintain a concurrent system structure
// allows for multiple readers/writers
type DeviceInfo struct {
Id uint32
Type string
Status string
Data string
TransactionId uint32
}
func NewStatusMonitor(ch chan *DeviceInfo) *StatusMonitor {
sm := &StatusMonitor{StatusChan:ch}
buf := make(map[uint32]*DeviceInfo)
sm.Status.Buffer = buf
return sm
}
type InfoStream struct {
// used for reactor and device status streams
sync.Mutex
Reactors chan *DeviceInfo
Listener listeners
}
type listeners struct {
sync.Mutex
s map[uint32] chan *DeviceInfo
}
func NewInfoStream() *InfoStream {
dch := make(chan *DeviceInfo)
lis := new(listeners)
s := &InfoStream{Stream:dch}
return s
}
func (s *InfoStream) Start() {
// consistency
go s.Listener()
}
// goal is to hook every new manager into the reactor status chan
func (s *InfoStream) AddSender() *StatusMonitor {
sm := NewStatusMonitor(s.Stream) // give the channel we monitor for incoming updates
return sm
}
func (s *InfoStream) AddListener(id uint32) *StatusMonitor {
s.Listener.Lock()
defer s.Listener.Unlock()
dChan := make(chan *DeviceInfo)
sm := NewStatusMonitor(dChan)
s.Listener.s[id] = dChan
return sm
}
func (s *InfoStream) Listener() {
for {
deviceInfo <-s.Stream
go s.Echo(deviceInfo) // going to send copy for now because f it
}
}
func (s *InfoStream) Echo(d *DeviceInfo) {
s.Listener.Lock()
defer s.Listener.Unlock()
for _,tm := range s.Listner.s {
go func() {
tm.StatusChan <-d
}
}
}
// status buffer maintaince
type StatusMonitor struct {
// serve as base to embed in managers to send/receive reactor info
TransactionID chan uint // monotonically increases to track outdated reqs
StatusChan chan *DeviceInfo // sending reactor info in same fmt
Status *sb //struct for storing and updating reactors
}
type sb struct {
sync.Mutex
buffer map[uint32]*DeviceInfo
}
type DevAcks struct {
Id uint32
TransactionId int
}
func (s *StatusMonitor) StartLis(devInfo []*DeviceInfo) {
s.Status.Lock()
defer s.Status.Unlock()
for _,dev := range devInfo {
s.Status.Buffer[dev.Id] = dev
}
go s.Listen()
}
func (s *StatusMonitor) Listen() {
// long running to handle incoming reqs
for {
status := <-s.StatusChan
go s.UpdateBuffer(status)
}
}
func (s *StatusMonitor) UpdateBuffer(dev *DeviceInfo) {
s.Status.Lock()
defer s.Status.Unlock()
if _, ok := s.Status.Buffer[dev.Id]; !ok {
s.Status.Buffer[dev.Id] = dev
} else if tid := s.Status.Buffer[dev.Id].TransactionId; tid < dev.TransactionId {
s.Status.Buffer[dev.Id] = dev
} // only other case is we recieved outdated update and we can safely discard
}
func (s *StatusMonitor) GetBuffer() []*DeviceInfo{
// get the buffer for client req and clear it for mow
s.Status.Lock()
defer s.Status.Unlock()
devs := []*DeviceInfo{}
for _, dev := range s.Status.Buffer {
devs = append(devs, dev)
delete(s.Status.Buffer,dev.Id)
}
return devs
}
func (s *StatusMonitor) EmptyBuffer(da []DevAcks) {
s.Status.Lock()
defer s.Status.Unlock()
for _, d := range da {
if d.TransactionId == s.Status.Buffer[d.Id].TransactionId {
// we acked a dev in buffer
// not going to check > because how would that even happen
delete(s.Status.Buffer, d.Id)
} // other case is our buffer has a newer entry (or older but again how)
}
}
// should be all the logic for actually monitoring a chan
// shouldnt matter whether it is sending reactor status or device status per reactor
// sender only needs to pass value onto chan
func (s *StatusMonitor) ReactorStart() {
go s.GenerateIds()
}
func (s *StatusMonitor) GenerateIds() {
var id uint
id = 0
for {
s.TransactionId <-id
id += 1
}
}
func (s *StatusMonitor) Send(d *DeviceInfo) {
d.TransactionId = <-s.TransactionId
s.StatusChan <-d
}
// now to tie it all together
type SystemViewer struct {
// stores system directory and provide methods to be embedded in managers
ReactorStream *InfoStream // can add itself as a listener to provide methods
DeviceStream ds
}
type ds struct {
Reactors map[uint32]*InfoStream //map from reactor id to its device info stream
sync.Mutex
}
func NewSystemViewer () *SystemViewer {
rs := NewInfoStream()
s := &SystemViewer{ReactorStream:rs}
ds := make(map[uint32]*InfoStream)
s.DeviceStream = ds
return s
}
func (s *SystemViewer) AddReactorListener(clientId uint32) *StatusMonitor {
return s.ReactorStream.AddListener(clientId)
}
func (s *SystemViewer) AddReactorSender() *StatusMonitor {
return s.ReactorStream.AddSender()
}
func (s *SystemViewer) AddDeviceListener(reactorId, clientId uint32) *StatusMonitor {
s.DeviceStream.Lock()
defer s.DeviceStream.Unlock()
var ds *InfoStream
var ok bool
if ds, ok = s.DeviceStream.Reactors[reactorId]; !ok {
ds = NewInfoStream()
s.DeviceStream.Reactors[reactorId] = ds
}
return ds.AddListener(clientId)
}
func (s *SystemViewer) DeviceSender(reactorId uint32) *StatusMonitor {
s.DeviceStream.Lock()
defer s.DeviceStream.Unlock()
var ds *InfoStream
var ok bool
if ds, ok = s.DeviceStream.Reactors[reactorId]; !ok {
ds = newInfoStream()
s.DeviceStream.Reactors[reactorId] = ds
}
return ds.AddSender()
}

@ -6,7 +6,7 @@ import (
// this package creates coordinators responsible for keeping track of active clients and invoking managers
type CreateManager interface {
NewManager(*Client, *System, chan error) GeneralManager
NewManager(*Client, chan error) GeneralManager
}
type GeneralManager interface {
@ -16,7 +16,6 @@ type GeneralManager interface {
type Coordinator struct {
*Managers
Sys *System
CreateManager
Err chan error
Pc chan int
@ -27,12 +26,11 @@ type Managers struct {
sync.Mutex
}
// interface stuff
func NewCoordinator(manager CreateManager, sys *System,err chan error) *Coordinator {
func NewCoordinator(manager CreateManager, err chan error) *Coordinator {
d := make(map[uint32]GeneralManager)
m := &Managers{Directory:d}
c := &Coordinator{Err:err}
c.CreateManager = manager
c.Sys = sys
c.Managers = m
return c
}
@ -56,7 +54,7 @@ func (c *Coordinator) GetManager(cl *Client) GeneralManager {
var m GeneralManager
if m, exists = c.Managers.Directory[cl.Id]; !exists {
// manager in memory
m = c.NewManager(cl, c.Sys, c.Err)
m = c.NewManager(cl, c.Err)
c.Managers.Directory[cl.Id] = m
}
return m
@ -64,26 +62,28 @@ func (c *Coordinator) GetManager(cl *Client) GeneralManager {
// reactor coordinator
type reactorCoordinator struct {
//empty unexported for method
Sys *SystemViewer
}
func (r *reactorCoordinator) NewManager(cl *Client, sys *System, err chan error) GeneralManager {
return NewReactorManager(cl,sys,err)
func (r *reactorCoordinator) NewManager(cl *Client, err chan error) GeneralManager {
return NewReactorManager(cl,r.Sys,err)
}
func NewReactorCoordinator(sys *System, err chan error) *Coordinator {
return NewCoordinator(&reactorCoordinator{}, sys, err)
func NewReactorCoordinator(sys *SystemViewer, err chan error) *Coordinator {
return NewCoordinator(&reactorCoordinator{Sys:sys}, err)
}
//tui coordinator
type tuiCoordinator struct {
//can add fields as needed
Ip string
Sys *SystemViewer
}
func (t *tuiCoordinator) NewManager(cl *Client, sys *System, err chan error) GeneralManager {
return NewTUIManager(t.Ip,cl,sys,err)
func (t *tuiCoordinator) NewManager(cl *Client, err chan error) GeneralManager {
return NewTUIManager(t.Ip,cl,t.Sys,err)
}
func NewTUICoordinator(ip string, sys *System, err chan error) *Coordinator {
return NewCoordinator(&tuiCoordinator{Ip:ip}, sys, err)
func NewTUICoordinator(ip string, sys *SystemViewer, err chan error) *Coordinator {
return NewCoordinator(&tuiCoordinator{Ip:ip,Sys:sys}, err)
}

@ -18,7 +18,7 @@ type Listener struct { // exporting for easy use in the short term
Ip string
Port int
Coordinators map[string]*Coordinator
Sys *System
Sys *SystemViewer
Err chan error
pb.UnimplementedHandshakeServer
}
@ -47,7 +47,7 @@ func NewListener(ifconfig string,ch chan error) (*Listener, error) {
c := make(map[string]*Coordinator)
l := &Listener{Ip:ip,Err:ch}
l.Coordinators = c
l.Sys = NewSystemStruct()
l.Sys = NewSystemViewer()
return l, nil
}
@ -56,6 +56,7 @@ func (l *Listener) Start() {
if err := l.Register(); err != nil {
l.Err <- err
}
go l.Sys.Start()
// listener started and grpc handler registered
log.Printf("Started listener on %v:%v\n",l.Ip,l.Port)
}

@ -5,7 +5,7 @@ import (
"time"
"log"
"context"
"sync"
_ "sync"
"google.golang.org/grpc"
"google.golang.org/grpc/status"
"google.golang.org/grpc/credentials/insecure"
@ -16,36 +16,33 @@ import (
type ReactorManager struct {
*Manager
Devs *Devices
*System
StatusMon *StatusMonitor
DevsMon *StatusMonitor
}
type Devices struct {
mu sync.Mutex
D map[int]Device
}
func NewReactorManager(c *Client,sys *System,err chan error) GeneralManager {
d := new(Devices)
r := &ReactorManager{Devs:d}
func NewReactorManager(c *Client,sys *SystemViewer,err chan error) GeneralManager {
r := &ReactorManager{}
r.Manager = NewManager(err)
r.System = sys
r.StatusMon = sys.AddReactorSender()
r.DevsMon = sys.AddDeviceSender(c.Id)
return r
}
func (r *ReactorManager) Start(cl *Client) {
r.Manager.Start(cl)
go r.StatusMon.Start()
go r.DevsMon.Start()
go r.StatusMon.Send(&DeviceInfo{Id:r.Id,Type:"Reactor",Status:"[green]ONLINE[white]"})
conn := r.Connect()
empty := &grpc.ClientConn{}
if conn != empty {
go r.UpdateReactor(r.Id,true)
go r.Monitor(conn)
}
}
func (r *ReactorManager) Exit() {
r.Manager.Exit()
go r.UpdateReactor(r.Id,false)
go r.StatusMon.Send(&DeviceInfo{Id:r.Id,Type:"Reactor",Status:"[red]OFFLINE[white]",Data:fmt.Sprintf(": Last Seen %v",time.Now().Format("Mon at 03:04:05pm"))})
}
func (r *ReactorManager) GetPort() int {
@ -100,7 +97,8 @@ func (r *ReactorManager) Monitor(conn *grpc.ClientConn) {
break;
}
for _,v := range resp.GetDevices() {
go r.System.UpdateReactorDevice(r.Id, int(v.GetAddr()), v.GetType(), v.GetStatus(), v.GetData())
d := &DeviceInfo{Id:uint32(v.GetAddr()),Type:v.GetType(),Status:v.GetStatus(),Data:v.GetData()}
go r.DevsMon.Send(d)
}
time.Sleep(r.Hb) // time between sensor pings
}

@ -7,86 +7,162 @@ import (
// package will create and maintain a concurrent system structure
// allows for multiple readers/writers
type DeviceInfo struct {
Id uint32
Type string
Status string
Data string
Index uint32
TransactionId uint32
}
type System struct {
sync.Mutex
Reactors map[uint32]*Reactor
func NewStatusMonitor(ch chan *DeviceInfo) *StatusMonitor {
tid := make(chan uint32)
sm := &StatusMonitor{StatusChan:ch,TransactionId:tid}
return sm
}
type Reactor struct {
Status bool
Devices map[int]*Device
type InfoStream struct {
// used for reactor and device status streams
sync.Mutex
Stream chan *DeviceInfo
Layout *syslayout
}
type Device struct {
Type string
Status string
Data string
type syslayout struct {
Devs map[uint32]*DeviceInfo
uint32 //index
sync.Mutex
}
type ReactorInfo struct {
Id uint32
Status bool
func NewInfoStream() *InfoStream {
dch := make(chan *DeviceInfo)
s := &InfoStream{Stream:dch}
m := make(map[uint32]*DeviceInfo)
s.Layout = &syslayout{Devs:m}
return s
}
type DeviceInfo struct {
Addr int
Type string
Status string
Data string
func (s *InfoStream) Start() {
// consistency
go s.Listener()
}
// goal is to hook every new manager into the reactor status chan
func (s *InfoStream) AddSender() *StatusMonitor {
sm := NewStatusMonitor(s.Stream) // give the channel we monitor for incoming updates
return sm
}
func NewSystemStruct() *System {
s := &System{}
r := make(map[uint32]*Reactor)
s.Reactors = r
return s
func (s *InfoStream) Listener() {
for {
deviceInfo := <-s.Stream
go s.Layout.Update(deviceInfo)
}
}
func (s *System) UpdateReactor(id uint32, status bool) {
func (s *syslayout) Update(d *DeviceInfo) {
s.Lock()
defer s.Unlock()
if _, exists := s.Reactors[id]; exists {
s.Reactors[id].Status = status
// set index to be kept for the entire time the dev exists
if dev, ok := s.Devs[d.Id]; !ok {
d.Index = s.uint32
s.uint32 += 1
} else {
m := make(map[int]*Device)
s.Reactors[id] = &Reactor{Status:status,Devices:m}
d.Index = dev.Index
}
s.Devs[d.Id] = d
}
func (s *System) UpdateReactorDevice(id uint32, addr int, t, st, d string) {
dev := &Device{Type:t, Status:st, Data:d}
go s.Reactors[id].UpdateDevice(addr, dev)
func (s *InfoStream) GetLayout() map[uint32]*DeviceInfo {
s.Layout.Lock()
defer s.Layout.Unlock()
return s.Layout.Devs
}
func (r *Reactor) UpdateDevice(addr int, d *Device) {
r.Lock()
defer r.Unlock()
r.Devices[addr] = d
// status buffer maintaince
type StatusMonitor struct {
// serve as base to embed in managers to send/receive reactor info
TransactionId chan uint32 // monotonically increases to track outdated reqs
StatusChan chan *DeviceInfo // sending reactor info in same fmt
}
func (s *System) GetReactors() []*ReactorInfo {
s.Lock()
defer s.Unlock()
rinfo := []*ReactorInfo{}
for id, r := range s.Reactors {
rinfo = append(rinfo,&ReactorInfo{Id:id,Status:r.Status})
func (s *StatusMonitor) Start() {
go s.GenerateIds()
}
func (s *StatusMonitor) GenerateIds() {
var id uint32
id = 0
for {
s.TransactionId <-id
id += 1
}
return rinfo
}
func (s *System) GetReactorDevices(id uint32) []*DeviceInfo {
return s.Reactors[id].GetDevices()
func (s *StatusMonitor) Send(d *DeviceInfo) {
d.TransactionId = <-s.TransactionId
s.StatusChan <-d
}
// now to tie it all together
type SystemViewer struct {
// stores system directory and provide methods to be embedded in managers
ReactorStream *InfoStream // can add itself as a listener to provide methods
DeviceStream *ds
}
type ds struct {
Reactors map[uint32]*InfoStream //map from reactor id to its device info stream
sync.Mutex
}
func NewSystemViewer() *SystemViewer {
rs := NewInfoStream()
s := &SystemViewer{ReactorStream:rs}
m := make(map[uint32]*InfoStream)
s.DeviceStream = &ds{Reactors:m}
return s
}
func (s *SystemViewer) Start() {
go s.ReactorStream.Start()
}
func (s *SystemViewer) AddReactorSender() *StatusMonitor {
return s.ReactorStream.AddSender()
}
func (s *SystemViewer) AddDeviceSender(reactorId uint32) *StatusMonitor {
s.DeviceStream.Lock()
defer s.DeviceStream.Unlock()
var ds *InfoStream
var ok bool
if ds, ok = s.DeviceStream.Reactors[reactorId]; !ok {
ds = NewInfoStream()
s.DeviceStream.Reactors[reactorId] = ds
go ds.Start()
}
return ds.AddSender()
}
func (s *SystemViewer) GetReactorStatus() map[uint32]DeviceInfo {
devs := s.ReactorStream.GetLayout()
ret := make(map[uint32]DeviceInfo)
for id, dev := range devs {
ret[id] = *dev
}
return ret //value instead of ptr
}
func (r *Reactor) GetDevices() []*DeviceInfo {
//
r.Lock()
defer r.Unlock()
di := []*DeviceInfo{}
for a,v := range r.Devices {
di = append(di, &DeviceInfo{Addr:a,Status:v.Status,Type:v.Type,Data:v.Data})
func (s *SystemViewer) GetDeviceStatus(reactorId uint32) map[uint32]DeviceInfo {
s.DeviceStream.Lock()
ds := s.DeviceStream.Reactors[reactorId]
s.DeviceStream.Unlock()
devs := ds.GetLayout()
ret := make(map[uint32]DeviceInfo)
for id, dev := range devs {
ret[id] = *dev
}
return di
return ret
}

@ -15,8 +15,8 @@ import (
type TUIManager struct {
*Manager // embedded manager for access to methods and client
*System
Ip string
*SystemViewer
Port *port
Err chan error
*pb.UnimplementedManagementServer
@ -27,12 +27,12 @@ type port struct {
int
}
func NewTUIManager(ip string, c *Client, sys *System, err chan error) GeneralManager {
func NewTUIManager(ip string, c *Client, sys *SystemViewer, err chan error) GeneralManager {
m := NewManager(err)
t := &TUIManager{Err: err}
t.Port = &port{Chan:make(chan int)}
t.Manager = m
t.System = sys
t.SystemViewer = sys
t.Ip = ip
return t
}
@ -65,23 +65,21 @@ func (t *TUIManager) GetPort() int {
return port
}
func (t *TUIManager) GetReactors(ctx context.Context, req *pb.GetReactorsRequest) (*pb.GetReactorsResponse, error) {
reactors := []*pb.Reactor{}
resp := &pb.GetReactorsResponse{ClientId:t.Id,Reactors:reactors}
r := t.System.GetReactors()
for _,v := range r {
resp.Reactors = append(resp.Reactors, &pb.Reactor{Id:v.Id,Status:v.Status})
}
return resp, nil
}
func (t *TUIManager) GetReactorDevices(ctx context.Context, req *pb.GetReactorDevicesRequest) (*pb.GetReactorDevicesResponse, error) {
func (t *TUIManager) GetDevices(ctx context.Context, req *pb.GetDevicesRequest) (*pb.GetDevicesResponse, error) {
rid := req.GetReactorId()
devs := t.System.GetReactorDevices(rid)
devices := []*pb.Dev{}
resp := &pb.GetReactorDevicesResponse{ClientId:t.Id,ReactorId:rid,Devices:devices}
for _, v := range devs {
resp.Devices = append(resp.Devices, &pb.Dev{Addr:int32(v.Addr),Type:v.Type,Status:v.Status,Data:v.Data})
resp := &pb.GetDevicesResponse{ClientId:t.Id,ReactorId:rid,Devices:devices}
reactors := t.SystemViewer.GetReactorStatus()
for _, v := range reactors {
resp.Devices = append(resp.Devices, &pb.Dev{Id:v.Id,Type:v.Type,Status:v.Status,Data:v.Data,Index:v.Index})
}
if rid != 0 {
// need reactor devices
devs := t.SystemViewer.GetDeviceStatus(rid)
for _, v := range devs {
resp.Devices = append(resp.Devices, &pb.Dev{Id:v.Id,Type:v.Type,Status:v.Status,Data:v.Data,Index:v.Index})
}
}
return resp, nil
}

@ -23,6 +23,7 @@ type TUIClient struct {
ClientConn *grpc.ClientConn
Active
}
type Active struct {
sync.Mutex
bool
@ -112,32 +113,25 @@ func (t *TUIClient) Connect() {
// going to redo this idk wtf i was thinking
// we just want a way to do two things
// a) get all devices when we first select a reactor
// b) ping the cs every 500ms-1s for updates and get back a list of devs that have changed
func (t *TUIClient) GetReactors() (map[uint32]*Reactor, error) {
req := &pb.GetReactorsRequest{}
r := make(map[uint32]*Reactor)
client := pb.NewManagementClient(t.ClientConn)
resp, err := client.GetReactors(context.Background(), req)
if err != nil {
return r, err
func (t *TUIClient) GetDevices(id ...uint32) (map[uint32]*Device, error) {
// returns
var rid uint32
if len(id) > 0 {
rid = id[0]
}
for _, v := range resp.GetReactors() {
m := make(map[int]*Device)
r[v.GetId()] = &Reactor{Status:v.GetStatus(),Devices:m}
}
return r, nil
}
func (t *TUIClient) GetReactorDevices(id uint32) (map[int]*Device, error) {
req := &pb.GetReactorDevicesRequest{}
r := make(map[int]*Device)
req := &pb.GetDevicesRequest{ClientId:t.Id,ReactorId:rid}
r := make(map[uint32]*Device)
client := pb.NewManagementClient(t.ClientConn)
resp, err := client.GetReactorDevices(context.Background(), req)
resp, err := client.GetDevices(context.Background(), req)
if err != nil {
return r, nil
}
for _, v := range resp.GetDevices() {
r[int(v.GetAddr())] = &Device{Type:v.GetType(),Status:v.GetStatus()}
r[v.GetId()] = &Device{Type:v.GetType(),Status:v.GetStatus(),Id:v.GetId(),Data:v.GetData(),Index:v.GetIndex()}
}
return r, err
}

@ -1,56 +0,0 @@
package tui
import (
_ "fmt"
"sync"
)
type LocalView struct {
sync.Mutex
Reactors map[uint32]*Reactor
*TUIClient // embedding for easy grpc calls
}
type Reactor struct {
Status bool
Devices map[int]*Device
}
type Device struct {
Type string
Status string
Data string
}
func (l *LocalView) UpdateReactors(id uint32, r *Reactor) {
l.Lock()
defer l.Unlock()
l.Reactors[id] = r
}
func (l *LocalView) UpdateReactorDevices(id uint32, addr int, d *Device) {
l.Lock()
defer l.Unlock()
if _, exists := l.Reactors[id]; !exists {
m := make(map[int]*Device)
l.Reactors[id] = &Reactor{Devices:m}
l.Reactors[id].Devices[addr] = d
}
l.Reactors[id].Devices[addr] = d
}
func (l *LocalView) GetReactors() map[uint32]bool {
l.Lock()
defer l.Unlock()
r := make(map[uint32]bool)
for a,s := range l.Reactors {
r[a] = s.Status
}
return r
}
func (l *LocalView) GetReactorDevices(id uint32) map[int]*Device {
l.Lock()
defer l.Unlock()
return l.Reactors[id].Devices
}

@ -9,6 +9,14 @@ import (
_ "github.com/gdamore/tcell/v2"
)
type Device struct {
Id uint32
Type string
Status string
Data string
Index uint32
}
type TUI struct {
*Display
//*LocalView
@ -44,9 +52,8 @@ func (t *TUI) CreateDisplay() {
c := make(chan uint32)
t.Display = NewDisplay(c)
t.SelectedReactor = c
t.ReactorList.AddItem("REACTOR IS ONLINE"," ",0,nil)
t.Flex.AddItem(t.ReactorList,0,1,true).
AddItem(t.DeviceList,0,2,false)
AddItem(t.DevicePages,0,2,false)
}
func (t *TUI) Monitor() {
@ -61,51 +68,56 @@ func (t *TUI) Monitor() {
for {
select {
case reactor := <-t.SelectedReactor:
//case reactor := <-t.SelectedReactor:
// reactor has been selected in tui, grabbing devs
go t.UpdateDevices(reactor)
//t.App.QueueUpdateDraw(func() {
// t.UpdateDevices(reactor)
//})
//devs := t.GetReactorDevices(reactor)
//t.DisplayReactorDevices(devs)
case <-timer:
// time to ping for status
t.App.QueueUpdateDraw(func() {
t.UpdateReactors()
t.UpdateDevices()
})
}
}
}
func (t *TUI) UpdateDevices(r uint32) {
func (t *TUI) UpdateDevices(r ...uint32) {
// get devices for the reactor and update the tui
devs, err := t.TUIClient.GetReactorDevices(r)
if err != nil {
log.Fatal(err)
var id uint32
if len(r) > 0 {
id = r[0]
}
//for a, d := range devs {
// go t.LocalView.UpdateReactorDevices(r,a,d)
//}
t.DisplayReactorDevices(devs)
}
func (t *TUI) UpdateReactors() {
// get all reactors and update the tui
reactors, err := t.TUIClient.GetReactors()
devs, err := t.TUIClient.GetDevices(id)
if err != nil {
log.Fatal(err)
}
t.DisplayReactors(reactors)
//for id, r := range reactors {
// go t.LocalView.UpdateReactors(id, r)
//}
if len(r) > 0 {
// reactor specificed
r := make(map[uint32]*Device)
d := make(map[uint32]*Device)
for id, dev := range devs {
if dev.Type == "Reactor" {
r[id] = dev
} else {
d[id] = dev
}
}
t.DisplayDevices(d)
t.DisplayReactors(r)
} else {
t.DisplayReactors(devs)
}
}
// display struct and logic
type Display struct {
App *tview.Application
Flex *tview.Flex
ReactorList *tview.List
DeviceList *tview.List
DevicePages *tview.Pages
SelectedReactor chan<- uint32
}
@ -114,9 +126,9 @@ func NewDisplay(ch chan uint32) *Display {
d.App = tview.NewApplication()
d.Flex = tview.NewFlex()
d.ReactorList = tview.NewList().ShowSecondaryText(false)
d.DeviceList = tview.NewList().ShowSecondaryText(false)
d.DevicePages = tview.NewPages()
d.ReactorList.SetTitle("Reactors").SetBorder(true)
d.DeviceList.SetTitle("Devices").SetBorder(true)
d.DevicePages.SetTitle("Devices").SetBorder(true)
d.SelectedReactor = ch
return d
}
@ -128,18 +140,25 @@ func (d *Display) Start() {
}
}
func (d *Display) DisplayReactors(r map[uint32]*Reactor) {
func (d *Display) DisplayDevices(devs map[uint32]*Device, rid ...uint32) {
for _, dev := range devs {
if dev.Type == "Reactor"{
//d.ReactorList.InsertItem(int(dev.Ind
} else if len(rid) > 0 {
//
fmt.Println("selected")
}
}
}
func (d *Display) DisplayReactors(r map[uint32]*Device) {
// function to display reactor list to table
d.ReactorList.Clear()
for id, reactor := range r {
var status string
if reactor.Status {
status = "[green]ONLINE"
} else {
status = "[red]OFFLINE"
txt := fmt.Sprintf("%v %v%v", reactor.Id, reactor.Status,reactor.Data)
if d.ReactorList.GetItemCount() > int(reactor.Index) {
d.ReactorList.RemoveItem(int(reactor.Index))
}
txt := fmt.Sprintf("%v is %v", id, status)
d.ReactorList.AddItem(txt,string(id),0,nil)
d.ReactorList.InsertItem(int(reactor.Index),txt,string(id),rune(49+reactor.Index),nil)
}
}
@ -151,19 +170,3 @@ func (d *Display) SelectReactor(index int, main, id string, r rune) {
d.SelectedReactor <-uint32(id)
}
}
func (d *Display) DisplayReactorDevices(devs map[int]*Device) {
//Function that displays devices to the table
//d.DeviceList.Clear()
for addr, dev := range devs {
var status string
if dev.Status == "ACTIVE" {
status = "[green]ACTIVE[white]"
} else if dev.Status == "KILLED" {
status = "[red]KILLED[white]"
}
txt := fmt.Sprintf("%v is %v at %x",dev.Type,status,addr)
d.DeviceList.AddItem(txt,"",0,nil)
}
d.App.Draw()
}

121
notes

@ -703,4 +703,125 @@ how to share the data between the client and tui?
- cons
- need to store/embed struct
systemviewer.go
TODO 7/7
time to make the synchronous system view
have a few ideas for the approach
a) make RM responsible for maintaining their own "branch" and store pointers to their branch
b) store the branch centrally and have the RM post changes
I like the idea of a central system viewer and you post updates to worker clients
a) posting updates vs calling methods
blocking vs non blocking
b)
lets layout expectations
RM should keep a current view of itself and whether it is online
- this should persist despite reactor outage
- in case of outage every sensor is UKNOWN
- optional last seen time for sensors/reactor
- exit should save to memory? persist for a given id?
- have a removal mechanism
- use case is to purge dead mechanism aka no black list
- each rm keeps most recent sensor view or reactor view in mem and can accept incoming system viewer connections
system viewer clients
- spawn 1 per tui client
- can do 2 things to any rm
a) call it for a complete copy which needs to be fast (gRPC?)
b) latch onto update chan to build its own copy for when the client requests the new devices
- follow a buffer -> client -> delete life cycle
system viewer "server"
a) spawn new system veiwer clients and direct them to the proper reactors
-aside: can we use this to replace coordinator system? just make a system directory
what are we already storing?
in coordinator we have a mapping of ids to managers for reactor and
what if we remap system viewer and coordiantor to system coordinator which does both
seems redudent to keep multiple system copies
- any speed concerns? Client connections spawning new managers?
- we must lock map
- channels is probably the answer here, just desync the whole process from itself
- listener gets incoming clients
- clients get parsed into a "Client" object and sent to system coodiantor
- types have slight diffences but essentially:
1) see if there is a stored manager or if we need to create one
1.5) create manager if it doesnt exits
2) start the manager with the client details
3) create 2 chans (<-reactor tui<-) for reactor & device info
now the divergence
Reactor Manager:
1) Connect to reactor and send initial ping
- if reactor ever doesnt respond (maybe backoff for unavailable) just kill manager and send offline to reactor status chan
2) As device info comes in start maintaining a system struct - this must persist exits and starts
3) For the sensor info coming in, send a copy on the chan to the void for all youre concerned
4) Respond to requests for entire system copies as clients initially connect
- probably just a method
5) only need to send reactor status on changes aka starts and exits
TUI Manager:
1) Buffer the currently known reactor status via chan hook
2) Wait (Timeout) for connection for tui client
- probably sub 5 seconds before we exit
- need to keep track via a last seen
3) respond with the buffered reactor info
4) on request for specific info
- request system viewer for the reactor info which will return the reactors sensor chan
- spawn goroutine to hook onto this chan and maintain a "local" copy of the new data for the client
- can probably make this more efficient but f it
- biggest buffer gets is # devs * size dev struct (bytes)
- drop anything but most recent
5) as client requests for info we either reply with the buffer from the hook or create a new buffer
6) translates into pages client side which are more efficent
7) could even look at batching these eventually
8) should probably kill the listeners (atleas the chan) when the tui client
a) disconnects
b) goes idle
System Coordinator must then
1) have a method to handle client connections that is concurrent safe
2) start client managers on connection
3) keep a directory of all the channels for clients for device and reactor info
4) link tui client managers to rm properly
no need for a name change coordinator will have
system viewing functions in systemview.go
alright check in time
now have system viewer
which embeds a straight up info stream
and a map from reactor ids -> Info streams
InfoStreams are structs with methods for adding listeners and senders
both return monitor objects which you can either
Send(device info)
or GetBuffer() and ClearBuffer([]da)
this is all the foundation
just need to wrap into a thing the coordinator can useor maybe even replace coordinator
systemviewer has 4 methods
every tui manager will embed a reactor listener
every reactor manager will embed a reactor sender
when a tui client selects a reactor we will embed the device listener
every reactor will be its own device sender
the only thing that happens after init is tui may add device listeners
should unify so that its only 1 ping request or a special request when we go to a page for the first time
ex devinfo
{
Id uint32 // either id or addr
Type string //['reactor','device'] set by rlc
Status string //set by sm
Data string //optional
Index //added by monitor for consistent location in tui
Transaction ID //added by server and discarded in reply
I may just scrap this shit in favor of a synced view
overhead is probably minimal anyway
redo listener bullshit to just route to the cs
tui clients will just get a fresh copy of the reactor info and device infofor every request

Loading…
Cancel
Save