From e93a7ed6cbff9a29a6715993f654306fe540f2dd Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Mon, 18 Nov 2024 23:13:02 +0200 Subject: [PATCH] feat: name fields and webtomaster new and patch rpcs --- go/proto/shared/target.pb.go | 99 ++--- go/proto/shared/worker.pb.go | 21 +- go/proto/webtomaster.pb.go | 645 ++++++++++++++++++++++++++++++-- go/proto/webtomaster_grpc.pb.go | 150 +++++++- proto/shared/target.proto | 10 +- proto/shared/worker.proto | 1 + proto/webtomaster.proto | 50 +++ rust/emerwen-proto/build.rs | 4 +- rust/emerwen-proto/src/lib.rs | 2 +- 9 files changed, 894 insertions(+), 88 deletions(-) diff --git a/go/proto/shared/target.pb.go b/go/proto/shared/target.pb.go index 2491f19..1ddbd13 100644 --- a/go/proto/shared/target.pb.go +++ b/go/proto/shared/target.pb.go @@ -82,6 +82,7 @@ type Target struct { // *Target_Ping // *Target_Get Method isTarget_Method `protobuf_oneof:"method"` + Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` } func (x *Target) Reset() { @@ -142,56 +143,63 @@ func (m *Target) GetMethod() isTarget_Method { return nil } -func (x *Target) GetPing() *Target_MethodPing { +func (x *Target) GetPing() *MethodPing { if x, ok := x.GetMethod().(*Target_Ping); ok { return x.Ping } return nil } -func (x *Target) GetGet() *Target_MethodGET { +func (x *Target) GetGet() *MethodGET { if x, ok := x.GetMethod().(*Target_Get); ok { return x.Get } return nil } +func (x *Target) GetName() string { + if x != nil { + return x.Name + } + return "" +} + type isTarget_Method interface { isTarget_Method() } type Target_Ping struct { - Ping *Target_MethodPing `protobuf:"bytes,4,opt,name=ping,proto3,oneof"` + Ping *MethodPing `protobuf:"bytes,4,opt,name=ping,proto3,oneof"` } type Target_Get struct { - Get *Target_MethodGET `protobuf:"bytes,5,opt,name=get,proto3,oneof"` + Get *MethodGET `protobuf:"bytes,5,opt,name=get,proto3,oneof"` } func (*Target_Ping) isTarget_Method() {} func (*Target_Get) isTarget_Method() {} -type Target_MethodPing struct { +type MethodPing struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *Target_MethodPing) Reset() { - *x = Target_MethodPing{} +func (x *MethodPing) Reset() { + *x = MethodPing{} mi := &file_shared_target_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Target_MethodPing) String() string { +func (x *MethodPing) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Target_MethodPing) ProtoMessage() {} +func (*MethodPing) ProtoMessage() {} -func (x *Target_MethodPing) ProtoReflect() protoreflect.Message { +func (x *MethodPing) ProtoReflect() protoreflect.Message { mi := &file_shared_target_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -203,12 +211,12 @@ func (x *Target_MethodPing) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Target_MethodPing.ProtoReflect.Descriptor instead. -func (*Target_MethodPing) Descriptor() ([]byte, []int) { - return file_shared_target_proto_rawDescGZIP(), []int{0, 0} +// Deprecated: Use MethodPing.ProtoReflect.Descriptor instead. +func (*MethodPing) Descriptor() ([]byte, []int) { + return file_shared_target_proto_rawDescGZIP(), []int{1} } -type Target_MethodGET struct { +type MethodGET struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -216,20 +224,20 @@ type Target_MethodGET struct { OkCodes []uint32 `protobuf:"varint,1,rep,packed,name=ok_codes,json=okCodes,proto3" json:"ok_codes,omitempty"` } -func (x *Target_MethodGET) Reset() { - *x = Target_MethodGET{} +func (x *MethodGET) Reset() { + *x = MethodGET{} mi := &file_shared_target_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Target_MethodGET) String() string { +func (x *MethodGET) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Target_MethodGET) ProtoMessage() {} +func (*MethodGET) ProtoMessage() {} -func (x *Target_MethodGET) ProtoReflect() protoreflect.Message { +func (x *MethodGET) ProtoReflect() protoreflect.Message { mi := &file_shared_target_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -241,12 +249,12 @@ func (x *Target_MethodGET) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Target_MethodGET.ProtoReflect.Descriptor instead. -func (*Target_MethodGET) Descriptor() ([]byte, []int) { - return file_shared_target_proto_rawDescGZIP(), []int{0, 1} +// Deprecated: Use MethodGET.ProtoReflect.Descriptor instead. +func (*MethodGET) Descriptor() ([]byte, []int) { + return file_shared_target_proto_rawDescGZIP(), []int{2} } -func (x *Target_MethodGET) GetOkCodes() []uint32 { +func (x *MethodGET) GetOkCodes() []uint32 { if x != nil { return x.OkCodes } @@ -258,29 +266,30 @@ var File_shared_target_proto protoreflect.FileDescriptor var file_shared_target_proto_rawDesc = []byte{ 0x0a, 0x13, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, - 0x68, 0x61, 0x72, 0x65, 0x64, 0x22, 0xf7, 0x01, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x22, 0xc7, 0x01, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, - 0x12, 0x37, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x12, 0x30, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x50, 0x69, 0x6e, - 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x34, 0x0a, 0x03, 0x67, 0x65, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, - 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x47, 0x45, 0x54, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, 0x74, 0x1a, - 0x0c, 0x0a, 0x0a, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x50, 0x69, 0x6e, 0x67, 0x1a, 0x26, 0x0a, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x50, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x69, + 0x6e, 0x67, 0x12, 0x2d, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, + 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x47, 0x45, 0x54, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, + 0x0c, 0x0a, 0x0a, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x50, 0x69, 0x6e, 0x67, 0x22, 0x26, 0x0a, 0x09, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x47, 0x45, 0x54, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x6b, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x07, 0x6f, 0x6b, - 0x43, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2a, - 0x2c, 0x0a, 0x0b, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x08, - 0x0a, 0x04, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x55, 0x50, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x42, 0x36, 0x5a, - 0x34, 0x67, 0x69, 0x74, 0x2e, 0x73, 0x72, 0x63, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2f, 0x7e, - 0x6c, 0x69, 0x6c, 0x6a, 0x61, 0x6d, 0x6f, 0x2f, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2d, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, - 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x6f, 0x64, 0x65, 0x73, 0x2a, 0x2c, 0x0a, 0x0b, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, + 0x0a, 0x02, 0x55, 0x50, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x02, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x2e, 0x73, 0x72, 0x63, 0x2e, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2f, 0x7e, 0x6c, 0x69, 0x6c, 0x6a, 0x61, 0x6d, 0x6f, 0x2f, 0x65, 0x6d, + 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -298,14 +307,14 @@ func file_shared_target_proto_rawDescGZIP() []byte { var file_shared_target_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_shared_target_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_shared_target_proto_goTypes = []any{ - (TargetState)(0), // 0: emerwen.shared.TargetState - (*Target)(nil), // 1: emerwen.shared.Target - (*Target_MethodPing)(nil), // 2: emerwen.shared.Target.MethodPing - (*Target_MethodGET)(nil), // 3: emerwen.shared.Target.MethodGET + (TargetState)(0), // 0: emerwen.shared.TargetState + (*Target)(nil), // 1: emerwen.shared.Target + (*MethodPing)(nil), // 2: emerwen.shared.MethodPing + (*MethodGET)(nil), // 3: emerwen.shared.MethodGET } var file_shared_target_proto_depIdxs = []int32{ - 2, // 0: emerwen.shared.Target.ping:type_name -> emerwen.shared.Target.MethodPing - 3, // 1: emerwen.shared.Target.get:type_name -> emerwen.shared.Target.MethodGET + 2, // 0: emerwen.shared.Target.ping:type_name -> emerwen.shared.MethodPing + 3, // 1: emerwen.shared.Target.get:type_name -> emerwen.shared.MethodGET 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name diff --git a/go/proto/shared/worker.pb.go b/go/proto/shared/worker.pb.go index ea4d198..89bf4a5 100644 --- a/go/proto/shared/worker.pb.go +++ b/go/proto/shared/worker.pb.go @@ -28,6 +28,7 @@ type Worker struct { Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` AuthToken string `protobuf:"bytes,2,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"` Targets []*Target `protobuf:"bytes,3,rep,name=targets,proto3" json:"targets,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` } func (x *Worker) Reset() { @@ -81,24 +82,32 @@ func (x *Worker) GetTargets() []*Target { return nil } +func (x *Worker) GetName() string { + if x != nil { + return x.Name + } + return "" +} + var File_shared_worker_proto protoreflect.FileDescriptor var file_shared_worker_proto_rawDesc = []byte{ 0x0a, 0x13, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x1a, 0x13, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x69, 0x0a, 0x06, 0x57, 0x6f, + 0x72, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7d, 0x0a, 0x06, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x30, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x73, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, 0x2e, 0x73, 0x72, 0x63, - 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2f, 0x7e, 0x6c, 0x69, 0x6c, 0x6a, 0x61, 0x6d, 0x6f, 0x2f, - 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, + 0x2e, 0x73, 0x72, 0x63, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2f, 0x7e, 0x6c, 0x69, 0x6c, 0x6a, + 0x61, 0x6d, 0x6f, 0x2f, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/go/proto/webtomaster.pb.go b/go/proto/webtomaster.pb.go index 02e7500..3c8394f 100644 --- a/go/proto/webtomaster.pb.go +++ b/go/proto/webtomaster.pb.go @@ -67,6 +67,490 @@ func (x *WorkersResponse) GetWorkers() []*shared.Worker { return nil } +type NewWorkerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *NewWorkerRequest) Reset() { + *x = NewWorkerRequest{} + mi := &file_webtomaster_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NewWorkerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewWorkerRequest) ProtoMessage() {} + +func (x *NewWorkerRequest) ProtoReflect() protoreflect.Message { + mi := &file_webtomaster_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewWorkerRequest.ProtoReflect.Descriptor instead. +func (*NewWorkerRequest) Descriptor() ([]byte, []int) { + return file_webtomaster_proto_rawDescGZIP(), []int{1} +} + +func (x *NewWorkerRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type NewWorkerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *NewWorkerResponse) Reset() { + *x = NewWorkerResponse{} + mi := &file_webtomaster_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NewWorkerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewWorkerResponse) ProtoMessage() {} + +func (x *NewWorkerResponse) ProtoReflect() protoreflect.Message { + mi := &file_webtomaster_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewWorkerResponse.ProtoReflect.Descriptor instead. +func (*NewWorkerResponse) Descriptor() ([]byte, []int) { + return file_webtomaster_proto_rawDescGZIP(), []int{2} +} + +func (x *NewWorkerResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type NewTargetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WorkerId uint32 `protobuf:"varint,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Addr string `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"` + Interval uint32 `protobuf:"varint,4,opt,name=interval,proto3" json:"interval,omitempty"` + // Types that are assignable to Method: + // + // *NewTargetRequest_Ping + // *NewTargetRequest_Get + Method isNewTargetRequest_Method `protobuf_oneof:"method"` +} + +func (x *NewTargetRequest) Reset() { + *x = NewTargetRequest{} + mi := &file_webtomaster_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NewTargetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewTargetRequest) ProtoMessage() {} + +func (x *NewTargetRequest) ProtoReflect() protoreflect.Message { + mi := &file_webtomaster_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewTargetRequest.ProtoReflect.Descriptor instead. +func (*NewTargetRequest) Descriptor() ([]byte, []int) { + return file_webtomaster_proto_rawDescGZIP(), []int{3} +} + +func (x *NewTargetRequest) GetWorkerId() uint32 { + if x != nil { + return x.WorkerId + } + return 0 +} + +func (x *NewTargetRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *NewTargetRequest) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *NewTargetRequest) GetInterval() uint32 { + if x != nil { + return x.Interval + } + return 0 +} + +func (m *NewTargetRequest) GetMethod() isNewTargetRequest_Method { + if m != nil { + return m.Method + } + return nil +} + +func (x *NewTargetRequest) GetPing() *shared.MethodPing { + if x, ok := x.GetMethod().(*NewTargetRequest_Ping); ok { + return x.Ping + } + return nil +} + +func (x *NewTargetRequest) GetGet() *shared.MethodGET { + if x, ok := x.GetMethod().(*NewTargetRequest_Get); ok { + return x.Get + } + return nil +} + +type isNewTargetRequest_Method interface { + isNewTargetRequest_Method() +} + +type NewTargetRequest_Ping struct { + Ping *shared.MethodPing `protobuf:"bytes,5,opt,name=ping,proto3,oneof"` +} + +type NewTargetRequest_Get struct { + Get *shared.MethodGET `protobuf:"bytes,6,opt,name=get,proto3,oneof"` +} + +func (*NewTargetRequest_Ping) isNewTargetRequest_Method() {} + +func (*NewTargetRequest_Get) isNewTargetRequest_Method() {} + +type NewTargetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *NewTargetResponse) Reset() { + *x = NewTargetResponse{} + mi := &file_webtomaster_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *NewTargetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NewTargetResponse) ProtoMessage() {} + +func (x *NewTargetResponse) ProtoReflect() protoreflect.Message { + mi := &file_webtomaster_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NewTargetResponse.ProtoReflect.Descriptor instead. +func (*NewTargetResponse) Descriptor() ([]byte, []int) { + return file_webtomaster_proto_rawDescGZIP(), []int{4} +} + +func (x *NewTargetResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type PatchWorkerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name *string `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"` +} + +func (x *PatchWorkerRequest) Reset() { + *x = PatchWorkerRequest{} + mi := &file_webtomaster_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PatchWorkerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchWorkerRequest) ProtoMessage() {} + +func (x *PatchWorkerRequest) ProtoReflect() protoreflect.Message { + mi := &file_webtomaster_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchWorkerRequest.ProtoReflect.Descriptor instead. +func (*PatchWorkerRequest) Descriptor() ([]byte, []int) { + return file_webtomaster_proto_rawDescGZIP(), []int{5} +} + +func (x *PatchWorkerRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +type PatchWorkerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *PatchWorkerResponse) Reset() { + *x = PatchWorkerResponse{} + mi := &file_webtomaster_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PatchWorkerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchWorkerResponse) ProtoMessage() {} + +func (x *PatchWorkerResponse) ProtoReflect() protoreflect.Message { + mi := &file_webtomaster_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchWorkerResponse.ProtoReflect.Descriptor instead. +func (*PatchWorkerResponse) Descriptor() ([]byte, []int) { + return file_webtomaster_proto_rawDescGZIP(), []int{6} +} + +func (x *PatchWorkerResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + +type PatchTargetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name *string `protobuf:"bytes,1,opt,name=name,proto3,oneof" json:"name,omitempty"` + Addr *string `protobuf:"bytes,2,opt,name=addr,proto3,oneof" json:"addr,omitempty"` + Interval *uint32 `protobuf:"varint,3,opt,name=interval,proto3,oneof" json:"interval,omitempty"` + // Types that are assignable to Method: + // + // *PatchTargetRequest_Ping + // *PatchTargetRequest_Get + Method isPatchTargetRequest_Method `protobuf_oneof:"method"` +} + +func (x *PatchTargetRequest) Reset() { + *x = PatchTargetRequest{} + mi := &file_webtomaster_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PatchTargetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchTargetRequest) ProtoMessage() {} + +func (x *PatchTargetRequest) ProtoReflect() protoreflect.Message { + mi := &file_webtomaster_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchTargetRequest.ProtoReflect.Descriptor instead. +func (*PatchTargetRequest) Descriptor() ([]byte, []int) { + return file_webtomaster_proto_rawDescGZIP(), []int{7} +} + +func (x *PatchTargetRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *PatchTargetRequest) GetAddr() string { + if x != nil && x.Addr != nil { + return *x.Addr + } + return "" +} + +func (x *PatchTargetRequest) GetInterval() uint32 { + if x != nil && x.Interval != nil { + return *x.Interval + } + return 0 +} + +func (m *PatchTargetRequest) GetMethod() isPatchTargetRequest_Method { + if m != nil { + return m.Method + } + return nil +} + +func (x *PatchTargetRequest) GetPing() *shared.MethodPing { + if x, ok := x.GetMethod().(*PatchTargetRequest_Ping); ok { + return x.Ping + } + return nil +} + +func (x *PatchTargetRequest) GetGet() *shared.MethodGET { + if x, ok := x.GetMethod().(*PatchTargetRequest_Get); ok { + return x.Get + } + return nil +} + +type isPatchTargetRequest_Method interface { + isPatchTargetRequest_Method() +} + +type PatchTargetRequest_Ping struct { + Ping *shared.MethodPing `protobuf:"bytes,4,opt,name=ping,proto3,oneof"` +} + +type PatchTargetRequest_Get struct { + Get *shared.MethodGET `protobuf:"bytes,5,opt,name=get,proto3,oneof"` +} + +func (*PatchTargetRequest_Ping) isPatchTargetRequest_Method() {} + +func (*PatchTargetRequest_Get) isPatchTargetRequest_Method() {} + +type PatchTargetResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` +} + +func (x *PatchTargetResponse) Reset() { + *x = PatchTargetResponse{} + mi := &file_webtomaster_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PatchTargetResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PatchTargetResponse) ProtoMessage() {} + +func (x *PatchTargetResponse) ProtoReflect() protoreflect.Message { + mi := &file_webtomaster_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PatchTargetResponse.ProtoReflect.Descriptor instead. +func (*PatchTargetResponse) Descriptor() ([]byte, []int) { + return file_webtomaster_proto_rawDescGZIP(), []int{8} +} + +func (x *PatchTargetResponse) GetSuccess() bool { + if x != nil { + return x.Success + } + return false +} + var File_webtomaster_proto protoreflect.FileDescriptor var file_webtomaster_proto_rawDesc = []byte{ @@ -74,22 +558,94 @@ var file_webtomaster_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x77, 0x6f, - 0x72, 0x6b, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x43, 0x0a, 0x0f, 0x57, 0x6f, - 0x72, 0x6b, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, - 0x07, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, - 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, - 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x07, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x32, - 0x59, 0x0a, 0x0b, 0x57, 0x65, 0x62, 0x54, 0x6f, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4a, - 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x24, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x77, - 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, - 0x74, 0x2e, 0x73, 0x72, 0x63, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2f, 0x7e, 0x6c, 0x69, 0x6c, - 0x6a, 0x61, 0x6d, 0x6f, 0x2f, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2d, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x64, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x43, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, + 0x61, 0x72, 0x65, 0x64, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x07, 0x77, 0x6f, 0x72, + 0x6b, 0x65, 0x72, 0x73, 0x22, 0x26, 0x0a, 0x10, 0x4e, 0x65, 0x77, 0x57, 0x6f, 0x72, 0x6b, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2d, 0x0a, 0x11, + 0x4e, 0x65, 0x77, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0xde, 0x01, 0x0a, 0x10, + 0x4e, 0x65, 0x77, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, + 0x6c, 0x12, 0x30, 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, + 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x50, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, + 0x69, 0x6e, 0x67, 0x12, 0x2d, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x64, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x47, 0x45, 0x54, 0x48, 0x00, 0x52, 0x03, 0x67, + 0x65, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, 0x2d, 0x0a, 0x11, + 0x4e, 0x65, 0x77, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x36, 0x0a, 0x12, 0x50, + 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x2f, 0x0a, 0x13, 0x50, 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, + 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x22, 0xf1, 0x01, 0x0a, 0x12, 0x50, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x02, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, + 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, + 0x03, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x30, + 0x0a, 0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, + 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x50, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x04, 0x70, 0x69, 0x6e, 0x67, + 0x12, 0x2d, 0x0a, 0x03, 0x67, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x4d, + 0x65, 0x74, 0x68, 0x6f, 0x64, 0x47, 0x45, 0x54, 0x48, 0x00, 0x52, 0x03, 0x67, 0x65, 0x74, 0x42, + 0x08, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x42, 0x0b, 0x0a, 0x09, 0x5f, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x2f, 0x0a, 0x13, 0x50, 0x61, 0x74, 0x63, + 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0xd5, 0x03, 0x0a, 0x0b, 0x57, 0x65, + 0x62, 0x54, 0x6f, 0x4d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x24, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x09, 0x4e, 0x65, 0x77, 0x57, 0x6f, 0x72, 0x6b, + 0x65, 0x72, 0x12, 0x25, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x77, 0x65, 0x62, + 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x4e, 0x65, 0x77, 0x57, 0x6f, 0x72, 0x6b, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6d, 0x65, 0x72, + 0x77, 0x65, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, + 0x4e, 0x65, 0x77, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5a, 0x0a, 0x09, 0x4e, 0x65, 0x77, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, + 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, + 0x73, 0x74, 0x65, 0x72, 0x2e, 0x4e, 0x65, 0x77, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, + 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x4e, 0x65, 0x77, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x60, 0x0a, + 0x0b, 0x50, 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x65, + 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, + 0x65, 0x72, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, + 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x74, 0x63, + 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x60, 0x0a, 0x0b, 0x50, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, + 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, + 0x73, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, + 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x50, 0x61, + 0x74, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x2e, 0x73, 0x72, 0x63, 0x2e, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x2f, 0x7e, 0x6c, 0x69, 0x6c, 0x6a, 0x61, 0x6d, 0x6f, 0x2f, 0x65, 0x6d, 0x65, 0x72, + 0x77, 0x65, 0x6e, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -104,21 +660,43 @@ func file_webtomaster_proto_rawDescGZIP() []byte { return file_webtomaster_proto_rawDescData } -var file_webtomaster_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_webtomaster_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_webtomaster_proto_goTypes = []any{ - (*WorkersResponse)(nil), // 0: emerwen.webtomaster.WorkersResponse - (*shared.Worker)(nil), // 1: emerwen.shared.Worker - (*emptypb.Empty)(nil), // 2: google.protobuf.Empty + (*WorkersResponse)(nil), // 0: emerwen.webtomaster.WorkersResponse + (*NewWorkerRequest)(nil), // 1: emerwen.webtomaster.NewWorkerRequest + (*NewWorkerResponse)(nil), // 2: emerwen.webtomaster.NewWorkerResponse + (*NewTargetRequest)(nil), // 3: emerwen.webtomaster.NewTargetRequest + (*NewTargetResponse)(nil), // 4: emerwen.webtomaster.NewTargetResponse + (*PatchWorkerRequest)(nil), // 5: emerwen.webtomaster.PatchWorkerRequest + (*PatchWorkerResponse)(nil), // 6: emerwen.webtomaster.PatchWorkerResponse + (*PatchTargetRequest)(nil), // 7: emerwen.webtomaster.PatchTargetRequest + (*PatchTargetResponse)(nil), // 8: emerwen.webtomaster.PatchTargetResponse + (*shared.Worker)(nil), // 9: emerwen.shared.Worker + (*shared.MethodPing)(nil), // 10: emerwen.shared.MethodPing + (*shared.MethodGET)(nil), // 11: emerwen.shared.MethodGET + (*emptypb.Empty)(nil), // 12: google.protobuf.Empty } var file_webtomaster_proto_depIdxs = []int32{ - 1, // 0: emerwen.webtomaster.WorkersResponse.workers:type_name -> emerwen.shared.Worker - 2, // 1: emerwen.webtomaster.WebToMaster.GetWorkers:input_type -> google.protobuf.Empty - 0, // 2: emerwen.webtomaster.WebToMaster.GetWorkers:output_type -> emerwen.webtomaster.WorkersResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] 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 + 9, // 0: emerwen.webtomaster.WorkersResponse.workers:type_name -> emerwen.shared.Worker + 10, // 1: emerwen.webtomaster.NewTargetRequest.ping:type_name -> emerwen.shared.MethodPing + 11, // 2: emerwen.webtomaster.NewTargetRequest.get:type_name -> emerwen.shared.MethodGET + 10, // 3: emerwen.webtomaster.PatchTargetRequest.ping:type_name -> emerwen.shared.MethodPing + 11, // 4: emerwen.webtomaster.PatchTargetRequest.get:type_name -> emerwen.shared.MethodGET + 12, // 5: emerwen.webtomaster.WebToMaster.GetWorkers:input_type -> google.protobuf.Empty + 1, // 6: emerwen.webtomaster.WebToMaster.NewWorker:input_type -> emerwen.webtomaster.NewWorkerRequest + 3, // 7: emerwen.webtomaster.WebToMaster.NewTarget:input_type -> emerwen.webtomaster.NewTargetRequest + 5, // 8: emerwen.webtomaster.WebToMaster.PatchWorker:input_type -> emerwen.webtomaster.PatchWorkerRequest + 7, // 9: emerwen.webtomaster.WebToMaster.PatchTarget:input_type -> emerwen.webtomaster.PatchTargetRequest + 0, // 10: emerwen.webtomaster.WebToMaster.GetWorkers:output_type -> emerwen.webtomaster.WorkersResponse + 2, // 11: emerwen.webtomaster.WebToMaster.NewWorker:output_type -> emerwen.webtomaster.NewWorkerResponse + 4, // 12: emerwen.webtomaster.WebToMaster.NewTarget:output_type -> emerwen.webtomaster.NewTargetResponse + 6, // 13: emerwen.webtomaster.WebToMaster.PatchWorker:output_type -> emerwen.webtomaster.PatchWorkerResponse + 8, // 14: emerwen.webtomaster.WebToMaster.PatchTarget:output_type -> emerwen.webtomaster.PatchTargetResponse + 10, // [10:15] is the sub-list for method output_type + 5, // [5:10] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_webtomaster_proto_init() } @@ -126,13 +704,22 @@ func file_webtomaster_proto_init() { if File_webtomaster_proto != nil { return } + file_webtomaster_proto_msgTypes[3].OneofWrappers = []any{ + (*NewTargetRequest_Ping)(nil), + (*NewTargetRequest_Get)(nil), + } + file_webtomaster_proto_msgTypes[5].OneofWrappers = []any{} + file_webtomaster_proto_msgTypes[7].OneofWrappers = []any{ + (*PatchTargetRequest_Ping)(nil), + (*PatchTargetRequest_Get)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_webtomaster_proto_rawDesc, NumEnums: 0, - NumMessages: 1, + NumMessages: 9, NumExtensions: 0, NumServices: 1, }, diff --git a/go/proto/webtomaster_grpc.pb.go b/go/proto/webtomaster_grpc.pb.go index 917fd39..62f6698 100644 --- a/go/proto/webtomaster_grpc.pb.go +++ b/go/proto/webtomaster_grpc.pb.go @@ -20,7 +20,11 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - WebToMaster_GetWorkers_FullMethodName = "/emerwen.webtomaster.WebToMaster/GetWorkers" + WebToMaster_GetWorkers_FullMethodName = "/emerwen.webtomaster.WebToMaster/GetWorkers" + WebToMaster_NewWorker_FullMethodName = "/emerwen.webtomaster.WebToMaster/NewWorker" + WebToMaster_NewTarget_FullMethodName = "/emerwen.webtomaster.WebToMaster/NewTarget" + WebToMaster_PatchWorker_FullMethodName = "/emerwen.webtomaster.WebToMaster/PatchWorker" + WebToMaster_PatchTarget_FullMethodName = "/emerwen.webtomaster.WebToMaster/PatchTarget" ) // WebToMasterClient is the client API for WebToMaster service. @@ -28,6 +32,10 @@ const ( // 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 WebToMasterClient interface { GetWorkers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*WorkersResponse, error) + NewWorker(ctx context.Context, in *NewWorkerRequest, opts ...grpc.CallOption) (*NewWorkerResponse, error) + NewTarget(ctx context.Context, in *NewTargetRequest, opts ...grpc.CallOption) (*NewTargetResponse, error) + PatchWorker(ctx context.Context, in *PatchWorkerRequest, opts ...grpc.CallOption) (*PatchWorkerResponse, error) + PatchTarget(ctx context.Context, in *PatchTargetRequest, opts ...grpc.CallOption) (*PatchTargetResponse, error) } type webToMasterClient struct { @@ -47,11 +55,51 @@ func (c *webToMasterClient) GetWorkers(ctx context.Context, in *emptypb.Empty, o return out, nil } +func (c *webToMasterClient) NewWorker(ctx context.Context, in *NewWorkerRequest, opts ...grpc.CallOption) (*NewWorkerResponse, error) { + out := new(NewWorkerResponse) + err := c.cc.Invoke(ctx, WebToMaster_NewWorker_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *webToMasterClient) NewTarget(ctx context.Context, in *NewTargetRequest, opts ...grpc.CallOption) (*NewTargetResponse, error) { + out := new(NewTargetResponse) + err := c.cc.Invoke(ctx, WebToMaster_NewTarget_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *webToMasterClient) PatchWorker(ctx context.Context, in *PatchWorkerRequest, opts ...grpc.CallOption) (*PatchWorkerResponse, error) { + out := new(PatchWorkerResponse) + err := c.cc.Invoke(ctx, WebToMaster_PatchWorker_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *webToMasterClient) PatchTarget(ctx context.Context, in *PatchTargetRequest, opts ...grpc.CallOption) (*PatchTargetResponse, error) { + out := new(PatchTargetResponse) + err := c.cc.Invoke(ctx, WebToMaster_PatchTarget_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // WebToMasterServer is the server API for WebToMaster service. // All implementations must embed UnimplementedWebToMasterServer // for forward compatibility type WebToMasterServer interface { GetWorkers(context.Context, *emptypb.Empty) (*WorkersResponse, error) + NewWorker(context.Context, *NewWorkerRequest) (*NewWorkerResponse, error) + NewTarget(context.Context, *NewTargetRequest) (*NewTargetResponse, error) + PatchWorker(context.Context, *PatchWorkerRequest) (*PatchWorkerResponse, error) + PatchTarget(context.Context, *PatchTargetRequest) (*PatchTargetResponse, error) mustEmbedUnimplementedWebToMasterServer() } @@ -62,6 +110,18 @@ type UnimplementedWebToMasterServer struct { func (UnimplementedWebToMasterServer) GetWorkers(context.Context, *emptypb.Empty) (*WorkersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetWorkers not implemented") } +func (UnimplementedWebToMasterServer) NewWorker(context.Context, *NewWorkerRequest) (*NewWorkerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewWorker not implemented") +} +func (UnimplementedWebToMasterServer) NewTarget(context.Context, *NewTargetRequest) (*NewTargetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method NewTarget not implemented") +} +func (UnimplementedWebToMasterServer) PatchWorker(context.Context, *PatchWorkerRequest) (*PatchWorkerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PatchWorker not implemented") +} +func (UnimplementedWebToMasterServer) PatchTarget(context.Context, *PatchTargetRequest) (*PatchTargetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PatchTarget not implemented") +} func (UnimplementedWebToMasterServer) mustEmbedUnimplementedWebToMasterServer() {} // UnsafeWebToMasterServer may be embedded to opt out of forward compatibility for this service. @@ -93,6 +153,78 @@ func _WebToMaster_GetWorkers_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _WebToMaster_NewWorker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NewWorkerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WebToMasterServer).NewWorker(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WebToMaster_NewWorker_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WebToMasterServer).NewWorker(ctx, req.(*NewWorkerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WebToMaster_NewTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NewTargetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WebToMasterServer).NewTarget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WebToMaster_NewTarget_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WebToMasterServer).NewTarget(ctx, req.(*NewTargetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WebToMaster_PatchWorker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PatchWorkerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WebToMasterServer).PatchWorker(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WebToMaster_PatchWorker_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WebToMasterServer).PatchWorker(ctx, req.(*PatchWorkerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WebToMaster_PatchTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PatchTargetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WebToMasterServer).PatchTarget(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WebToMaster_PatchTarget_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WebToMasterServer).PatchTarget(ctx, req.(*PatchTargetRequest)) + } + return interceptor(ctx, in, info, handler) +} + // WebToMaster_ServiceDesc is the grpc.ServiceDesc for WebToMaster service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -104,6 +236,22 @@ var WebToMaster_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetWorkers", Handler: _WebToMaster_GetWorkers_Handler, }, + { + MethodName: "NewWorker", + Handler: _WebToMaster_NewWorker_Handler, + }, + { + MethodName: "NewTarget", + Handler: _WebToMaster_NewTarget_Handler, + }, + { + MethodName: "PatchWorker", + Handler: _WebToMaster_PatchWorker_Handler, + }, + { + MethodName: "PatchTarget", + Handler: _WebToMaster_PatchTarget_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "webtomaster.proto", diff --git a/proto/shared/target.proto b/proto/shared/target.proto index cc79aa1..7b79da8 100644 --- a/proto/shared/target.proto +++ b/proto/shared/target.proto @@ -11,11 +11,13 @@ message Target { MethodPing ping = 4; MethodGET get = 5; } + string name = 6; +} - message MethodPing {} - message MethodGET { - repeated uint32 ok_codes = 1; - } +message MethodPing {} + +message MethodGET { + repeated uint32 ok_codes = 1; } enum TargetState { diff --git a/proto/shared/worker.proto b/proto/shared/worker.proto index 5ec7975..acf7d97 100644 --- a/proto/shared/worker.proto +++ b/proto/shared/worker.proto @@ -9,4 +9,5 @@ message Worker { uint32 id = 1; string auth_token = 2; repeated shared.Target targets = 3; + string name = 4; } diff --git a/proto/webtomaster.proto b/proto/webtomaster.proto index 14dbafc..831bcf2 100644 --- a/proto/webtomaster.proto +++ b/proto/webtomaster.proto @@ -4,12 +4,62 @@ package emerwen.webtomaster; option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto"; import "google/protobuf/empty.proto"; +import "shared/target.proto"; import "shared/worker.proto"; service WebToMaster { rpc GetWorkers (google.protobuf.Empty) returns (WorkersResponse); + rpc NewWorker (NewWorkerRequest) returns (NewWorkerResponse); + rpc NewTarget (NewTargetRequest) returns (NewTargetResponse); + rpc PatchWorker (PatchWorkerRequest) returns (PatchWorkerResponse); + rpc PatchTarget (PatchTargetRequest) returns (PatchTargetResponse); } message WorkersResponse { repeated shared.Worker workers = 1; } + +message NewWorkerRequest { + string name = 1; +} + +message NewWorkerResponse { + bool success = 1; +} + +message NewTargetRequest { + uint32 worker_id = 1; + string name = 2; + string addr = 3; + uint32 interval = 4; + oneof method { + shared.MethodPing ping = 5; + shared.MethodGET get = 6; + } +} + +message NewTargetResponse { + bool success = 1; +} + +message PatchWorkerRequest { + optional string name = 1; +} + +message PatchWorkerResponse { + bool success = 1; +} + +message PatchTargetRequest { + optional string name = 1; + optional string addr = 2; + optional uint32 interval = 3; + oneof method { + shared.MethodPing ping = 4; + shared.MethodGET get = 5; + } +} + +message PatchTargetResponse { + bool success = 1; +} diff --git a/rust/emerwen-proto/build.rs b/rust/emerwen-proto/build.rs index a612322..4df5bd8 100644 --- a/rust/emerwen-proto/build.rs +++ b/rust/emerwen-proto/build.rs @@ -7,11 +7,11 @@ fn main() -> Result<(), Box> { "#[derive(serde::Deserialize, serde::Serialize)]", ) .type_attribute( - "Target.MethodPing", + "MethodPing", "#[derive(serde::Deserialize, serde::Serialize)]", ) .type_attribute( - "Target.MethodGET", + "MethodGET", "#[derive(serde::Deserialize, serde::Serialize)]", ) .type_attribute("Worker", "#[derive(serde::Deserialize, serde::Serialize)]") diff --git a/rust/emerwen-proto/src/lib.rs b/rust/emerwen-proto/src/lib.rs index 0dee097..f1f8f54 100644 --- a/rust/emerwen-proto/src/lib.rs +++ b/rust/emerwen-proto/src/lib.rs @@ -7,7 +7,7 @@ tonic::include_proto!("mod"); -use emerwen::shared::target::{Method, MethodGet, MethodPing}; +use emerwen::shared::{target::Method, MethodGet, MethodPing}; impl From for Method { fn from(value: MethodPing) -> Self { -- 2.44.1