DEVELOPMENT ENVIRONMENT

~liljamo/emerwen-proto

8aa1fdcc154e6f7b62c29356fc8d34dffa4f1fe4 — Jonni Liljamo 5 hours ago 4437899
feat!: iteration number whatever, revamp whooo!

* change a bunch of field types, positions, names
* rename services
* bidirectional worker control service
12 files changed, 463 insertions(+), 624 deletions(-)

R go/proto/{webtomaster.pb.go => coordinatorcontrol.pb.go}
R go/proto/{webtomaster_grpc.pb.go => coordinatorcontrol_grpc.pb.go}
M go/proto/shared/target.pb.go
M go/proto/shared/worker.pb.go
M justfile
R proto/{webtomaster.proto => coordinatorcontrol.proto}
M proto/shared/target.proto
M proto/shared/worker.proto
A proto/workercontrol.proto
D proto/workertomaster.proto
M rust/emerwen-proto/build.rs
M rust/emerwen-proto/src/lib.rs
R go/proto/webtomaster.pb.go => go/proto/coordinatorcontrol.pb.go +204 -264
@@ 2,7 2,7 @@
// versions:
// 	protoc-gen-go v1.35.1
// 	protoc        v5.28.3
// source: webtomaster.proto
// source: coordinatorcontrol.proto

package proto



@@ 32,7 32,7 @@ type WorkersResponse struct {

func (x *WorkersResponse) Reset() {
	*x = WorkersResponse{}
	mi := &file_webtomaster_proto_msgTypes[0]
	mi := &file_coordinatorcontrol_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}


@@ 44,7 44,7 @@ func (x *WorkersResponse) String() string {
func (*WorkersResponse) ProtoMessage() {}

func (x *WorkersResponse) ProtoReflect() protoreflect.Message {
	mi := &file_webtomaster_proto_msgTypes[0]
	mi := &file_coordinatorcontrol_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {


@@ 57,7 57,7 @@ func (x *WorkersResponse) ProtoReflect() protoreflect.Message {

// Deprecated: Use WorkersResponse.ProtoReflect.Descriptor instead.
func (*WorkersResponse) Descriptor() ([]byte, []int) {
	return file_webtomaster_proto_rawDescGZIP(), []int{0}
	return file_coordinatorcontrol_proto_rawDescGZIP(), []int{0}
}

func (x *WorkersResponse) GetWorkers() []*shared.Worker {


@@ 77,7 77,7 @@ type NewWorkerRequest struct {

func (x *NewWorkerRequest) Reset() {
	*x = NewWorkerRequest{}
	mi := &file_webtomaster_proto_msgTypes[1]
	mi := &file_coordinatorcontrol_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}


@@ 89,7 89,7 @@ func (x *NewWorkerRequest) String() string {
func (*NewWorkerRequest) ProtoMessage() {}

func (x *NewWorkerRequest) ProtoReflect() protoreflect.Message {
	mi := &file_webtomaster_proto_msgTypes[1]
	mi := &file_coordinatorcontrol_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {


@@ 102,7 102,7 @@ func (x *NewWorkerRequest) ProtoReflect() protoreflect.Message {

// Deprecated: Use NewWorkerRequest.ProtoReflect.Descriptor instead.
func (*NewWorkerRequest) Descriptor() ([]byte, []int) {
	return file_webtomaster_proto_rawDescGZIP(), []int{1}
	return file_coordinatorcontrol_proto_rawDescGZIP(), []int{1}
}

func (x *NewWorkerRequest) GetName() string {


@@ 123,7 123,7 @@ type PatchWorkerRequest struct {

func (x *PatchWorkerRequest) Reset() {
	*x = PatchWorkerRequest{}
	mi := &file_webtomaster_proto_msgTypes[2]
	mi := &file_coordinatorcontrol_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}


@@ 135,7 135,7 @@ func (x *PatchWorkerRequest) String() string {
func (*PatchWorkerRequest) ProtoMessage() {}

func (x *PatchWorkerRequest) ProtoReflect() protoreflect.Message {
	mi := &file_webtomaster_proto_msgTypes[2]
	mi := &file_coordinatorcontrol_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {


@@ 148,7 148,7 @@ func (x *PatchWorkerRequest) ProtoReflect() protoreflect.Message {

// Deprecated: Use PatchWorkerRequest.ProtoReflect.Descriptor instead.
func (*PatchWorkerRequest) Descriptor() ([]byte, []int) {
	return file_webtomaster_proto_rawDescGZIP(), []int{2}
	return file_coordinatorcontrol_proto_rawDescGZIP(), []int{2}
}

func (x *PatchWorkerRequest) GetWorkerId() string {


@@ 175,7 175,7 @@ type DeleteWorkerRequest struct {

func (x *DeleteWorkerRequest) Reset() {
	*x = DeleteWorkerRequest{}
	mi := &file_webtomaster_proto_msgTypes[3]
	mi := &file_coordinatorcontrol_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}


@@ 187,7 187,7 @@ func (x *DeleteWorkerRequest) String() string {
func (*DeleteWorkerRequest) ProtoMessage() {}

func (x *DeleteWorkerRequest) ProtoReflect() protoreflect.Message {
	mi := &file_webtomaster_proto_msgTypes[3]
	mi := &file_coordinatorcontrol_proto_msgTypes[3]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {


@@ 200,7 200,7 @@ func (x *DeleteWorkerRequest) ProtoReflect() protoreflect.Message {

// Deprecated: Use DeleteWorkerRequest.ProtoReflect.Descriptor instead.
func (*DeleteWorkerRequest) Descriptor() ([]byte, []int) {
	return file_webtomaster_proto_rawDescGZIP(), []int{3}
	return file_coordinatorcontrol_proto_rawDescGZIP(), []int{3}
}

func (x *DeleteWorkerRequest) GetWorkerId() string {


@@ 215,20 215,17 @@ type NewTargetRequest struct {
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	WorkerId string `protobuf:"bytes,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 int32  `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"`
	WorkerId string        `protobuf:"bytes,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 int32         `protobuf:"varint,4,opt,name=interval,proto3" json:"interval,omitempty"`
	Method   shared.Method `protobuf:"varint,5,opt,name=method,proto3,enum=emerwen.shared.Method" json:"method,omitempty"`
	OkCodes  []int32       `protobuf:"varint,6,rep,packed,name=ok_codes,json=okCodes,proto3" json:"ok_codes,omitempty"`
}

func (x *NewTargetRequest) Reset() {
	*x = NewTargetRequest{}
	mi := &file_webtomaster_proto_msgTypes[4]
	mi := &file_coordinatorcontrol_proto_msgTypes[4]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}


@@ 240,7 237,7 @@ func (x *NewTargetRequest) String() string {
func (*NewTargetRequest) ProtoMessage() {}

func (x *NewTargetRequest) ProtoReflect() protoreflect.Message {
	mi := &file_webtomaster_proto_msgTypes[4]
	mi := &file_coordinatorcontrol_proto_msgTypes[4]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {


@@ 253,7 250,7 @@ func (x *NewTargetRequest) ProtoReflect() protoreflect.Message {

// Deprecated: Use NewTargetRequest.ProtoReflect.Descriptor instead.
func (*NewTargetRequest) Descriptor() ([]byte, []int) {
	return file_webtomaster_proto_rawDescGZIP(), []int{4}
	return file_coordinatorcontrol_proto_rawDescGZIP(), []int{4}
}

func (x *NewTargetRequest) GetWorkerId() string {


@@ 284,62 281,36 @@ func (x *NewTargetRequest) GetInterval() int32 {
	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
func (x *NewTargetRequest) GetMethod() shared.Method {
	if x != nil {
		return x.Method
	}
	return nil
	return shared.Method(0)
}

func (x *NewTargetRequest) GetGet() *shared.MethodGET {
	if x, ok := x.GetMethod().(*NewTargetRequest_Get); ok {
		return x.Get
func (x *NewTargetRequest) GetOkCodes() []int32 {
	if x != nil {
		return x.OkCodes
	}
	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 PatchTargetRequest struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	TargetId string  `protobuf:"bytes,1,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"`
	Name     *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
	Addr     *string `protobuf:"bytes,3,opt,name=addr,proto3,oneof" json:"addr,omitempty"`
	Interval *int32  `protobuf:"varint,4,opt,name=interval,proto3,oneof" json:"interval,omitempty"`
	// Types that are assignable to Method:
	//
	//	*PatchTargetRequest_Ping
	//	*PatchTargetRequest_Get
	Method isPatchTargetRequest_Method `protobuf_oneof:"method"`
	TargetId string         `protobuf:"bytes,1,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"`
	Name     *string        `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"`
	Addr     *string        `protobuf:"bytes,3,opt,name=addr,proto3,oneof" json:"addr,omitempty"`
	Interval *int32         `protobuf:"varint,4,opt,name=interval,proto3,oneof" json:"interval,omitempty"`
	Method   *shared.Method `protobuf:"varint,5,opt,name=method,proto3,enum=emerwen.shared.Method,oneof" json:"method,omitempty"`
	OkCodes  []int32        `protobuf:"varint,6,rep,packed,name=ok_codes,json=okCodes,proto3" json:"ok_codes,omitempty"`
}

func (x *PatchTargetRequest) Reset() {
	*x = PatchTargetRequest{}
	mi := &file_webtomaster_proto_msgTypes[5]
	mi := &file_coordinatorcontrol_proto_msgTypes[5]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}


@@ 351,7 322,7 @@ func (x *PatchTargetRequest) String() string {
func (*PatchTargetRequest) ProtoMessage() {}

func (x *PatchTargetRequest) ProtoReflect() protoreflect.Message {
	mi := &file_webtomaster_proto_msgTypes[5]
	mi := &file_coordinatorcontrol_proto_msgTypes[5]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {


@@ 364,7 335,7 @@ func (x *PatchTargetRequest) ProtoReflect() protoreflect.Message {

// Deprecated: Use PatchTargetRequest.ProtoReflect.Descriptor instead.
func (*PatchTargetRequest) Descriptor() ([]byte, []int) {
	return file_webtomaster_proto_rawDescGZIP(), []int{5}
	return file_coordinatorcontrol_proto_rawDescGZIP(), []int{5}
}

func (x *PatchTargetRequest) GetTargetId() string {


@@ 395,43 366,20 @@ func (x *PatchTargetRequest) GetInterval() int32 {
	return 0
}

func (m *PatchTargetRequest) GetMethod() isPatchTargetRequest_Method {
	if m != nil {
		return m.Method
func (x *PatchTargetRequest) GetMethod() shared.Method {
	if x != nil && x.Method != nil {
		return *x.Method
	}
	return nil
}

func (x *PatchTargetRequest) GetPing() *shared.MethodPing {
	if x, ok := x.GetMethod().(*PatchTargetRequest_Ping); ok {
		return x.Ping
	}
	return nil
	return shared.Method(0)
}

func (x *PatchTargetRequest) GetGet() *shared.MethodGET {
	if x, ok := x.GetMethod().(*PatchTargetRequest_Get); ok {
		return x.Get
func (x *PatchTargetRequest) GetOkCodes() []int32 {
	if x != nil {
		return x.OkCodes
	}
	return nil
}

type isPatchTargetRequest_Method interface {
	isPatchTargetRequest_Method()
}

type PatchTargetRequest_Ping struct {
	Ping *shared.MethodPing `protobuf:"bytes,5,opt,name=ping,proto3,oneof"`
}

type PatchTargetRequest_Get struct {
	Get *shared.MethodGET `protobuf:"bytes,6,opt,name=get,proto3,oneof"`
}

func (*PatchTargetRequest_Ping) isPatchTargetRequest_Method() {}

func (*PatchTargetRequest_Get) isPatchTargetRequest_Method() {}

type DeleteTargetRequest struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache


@@ 442,7 390,7 @@ type DeleteTargetRequest struct {

func (x *DeleteTargetRequest) Reset() {
	*x = DeleteTargetRequest{}
	mi := &file_webtomaster_proto_msgTypes[6]
	mi := &file_coordinatorcontrol_proto_msgTypes[6]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}


@@ 454,7 402,7 @@ func (x *DeleteTargetRequest) String() string {
func (*DeleteTargetRequest) ProtoMessage() {}

func (x *DeleteTargetRequest) ProtoReflect() protoreflect.Message {
	mi := &file_webtomaster_proto_msgTypes[6]
	mi := &file_coordinatorcontrol_proto_msgTypes[6]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {


@@ 467,7 415,7 @@ func (x *DeleteTargetRequest) ProtoReflect() protoreflect.Message {

// Deprecated: Use DeleteTargetRequest.ProtoReflect.Descriptor instead.
func (*DeleteTargetRequest) Descriptor() ([]byte, []int) {
	return file_webtomaster_proto_rawDescGZIP(), []int{6}
	return file_coordinatorcontrol_proto_rawDescGZIP(), []int{6}
}

func (x *DeleteTargetRequest) GetTargetId() string {


@@ 477,190 425,182 @@ func (x *DeleteTargetRequest) GetTargetId() string {
	return ""
}

var File_webtomaster_proto protoreflect.FileDescriptor

var file_webtomaster_proto_rawDesc = []byte{
	0x0a, 0x11, 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72,
	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, 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, 0x53, 0x0a, 0x12,
	0x50, 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 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, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x49, 0x64, 0x12,
	0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 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, 0x32, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x65,
	0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b,
var File_coordinatorcontrol_proto protoreflect.FileDescriptor

var file_coordinatorcontrol_proto_rawDesc = []byte{
	0x0a, 0x18, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x63, 0x6f, 0x6e,
	0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x65, 0x6d, 0x65, 0x72,
	0x77, 0x65, 0x6e, 0x2e, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x63,
	0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 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, 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, 0x53, 0x0a, 0x12, 0x50, 0x61,
	0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 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, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x49, 0x64, 0x12, 0x17, 0x0a,
	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 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,
	0x32, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 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, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72, 0x6b, 0x65,
	0x72, 0x49, 0x64, 0x22, 0xbe, 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, 0x09, 0x52, 0x08, 0x77, 0x6f, 0x72,
	0x6b, 0x65, 0x72, 0x49, 0x64, 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, 0x09, 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,
	0x05, 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,
	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, 0x05, 0x52,
	0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x2e, 0x0a, 0x06, 0x6d, 0x65, 0x74,
	0x68, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 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, 0x8e, 0x02, 0x0a, 0x12, 0x50, 0x61, 0x74, 0x63, 0x68,
	0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a,
	0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
	0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61,
	0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
	0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 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, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x03,
	0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a,
	0x04, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6d,
	0x64, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x6b, 0x5f,
	0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x6f, 0x6b, 0x43,
	0x6f, 0x64, 0x65, 0x73, 0x22, 0xfe, 0x01, 0x0a, 0x12, 0x50, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61,
	0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74,
	0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
	0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01,
	0x01, 0x12, 0x17, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48,
	0x01, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x69, 0x6e,
	0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x08,
	0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x06, 0x6d,
	0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 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, 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, 0x32, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74,
	0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b,
	0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
	0x09, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x32, 0xb5, 0x04, 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, 0x4a, 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, 0x16, 0x2e, 0x67, 0x6f,
	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
	0x70, 0x74, 0x79, 0x12, 0x4e, 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, 0x16, 0x2e, 0x67, 0x6f,
	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
	0x70, 0x74, 0x79, 0x12, 0x50, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x72,
	0x67, 0x65, 0x74, 0x12, 0x28, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x77, 0x65,
	0x62, 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
	0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
	0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
	0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x4a, 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, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
	0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
	0x79, 0x12, 0x4e, 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, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
	0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
	0x79, 0x12, 0x50, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x65,
	0x72, 0x12, 0x28, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x74,
	0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f,
	0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
	0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
	0x70, 0x74, 0x79, 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,
	0x68, 0x6f, 0x64, 0x48, 0x03, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x88, 0x01, 0x01,
	0x12, 0x19, 0x0a, 0x08, 0x6f, 0x6b, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03,
	0x28, 0x05, 0x52, 0x07, 0x6f, 0x6b, 0x43, 0x6f, 0x64, 0x65, 0x73, 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, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6d,
	0x65, 0x74, 0x68, 0x6f, 0x64, 0x22, 0x32, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54,
	0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09,
	0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
	0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x32, 0xf4, 0x04, 0x0a, 0x19, 0x43, 0x6f,
	0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
	0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x51, 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, 0x2b, 0x2e,
	0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61,
	0x74, 0x6f, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x65,
	0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x09, 0x4e, 0x65,
	0x77, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x2c, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65,
	0x6e, 0x2e, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x63, 0x6f, 0x6e,
	0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4e, 0x65, 0x77, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65,
	0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x55, 0x0a,
	0x0b, 0x50, 0x61, 0x74, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x2e, 0x2e, 0x65,
	0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74,
	0x6f, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x50, 0x61, 0x74, 0x63, 0x68, 0x57,
	0x6f, 0x72, 0x6b, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67,
	0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,
	0x6d, 0x70, 0x74, 0x79, 0x12, 0x57, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61,
	0x72, 0x67, 0x65, 0x74, 0x12, 0x2f, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x63,
	0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f,
	0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65,
	0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
	0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x51, 0x0a,
	0x09, 0x4e, 0x65, 0x77, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2c, 0x2e, 0x65, 0x6d, 0x65,
	0x72, 0x77, 0x65, 0x6e, 0x2e, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72,
	0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x4e, 0x65, 0x77, 0x54, 0x61, 0x72, 0x67, 0x65,
	0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
	0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
	0x12, 0x55, 0x0a, 0x0b, 0x50, 0x61, 0x74, 0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12,
	0x2e, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69,
	0x6e, 0x61, 0x74, 0x6f, 0x72, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x50, 0x61, 0x74,
	0x63, 0x68, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
	0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
	0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x57, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74,
	0x65, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x2f, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65,
	0x6e, 0x2e, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x6f, 0x72, 0x63, 0x6f, 0x6e,
	0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x65,
	0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
	0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
	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 (
	file_webtomaster_proto_rawDescOnce sync.Once
	file_webtomaster_proto_rawDescData = file_webtomaster_proto_rawDesc
	file_coordinatorcontrol_proto_rawDescOnce sync.Once
	file_coordinatorcontrol_proto_rawDescData = file_coordinatorcontrol_proto_rawDesc
)

func file_webtomaster_proto_rawDescGZIP() []byte {
	file_webtomaster_proto_rawDescOnce.Do(func() {
		file_webtomaster_proto_rawDescData = protoimpl.X.CompressGZIP(file_webtomaster_proto_rawDescData)
func file_coordinatorcontrol_proto_rawDescGZIP() []byte {
	file_coordinatorcontrol_proto_rawDescOnce.Do(func() {
		file_coordinatorcontrol_proto_rawDescData = protoimpl.X.CompressGZIP(file_coordinatorcontrol_proto_rawDescData)
	})
	return file_webtomaster_proto_rawDescData
}

var file_webtomaster_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_webtomaster_proto_goTypes = []any{
	(*WorkersResponse)(nil),     // 0: emerwen.webtomaster.WorkersResponse
	(*NewWorkerRequest)(nil),    // 1: emerwen.webtomaster.NewWorkerRequest
	(*PatchWorkerRequest)(nil),  // 2: emerwen.webtomaster.PatchWorkerRequest
	(*DeleteWorkerRequest)(nil), // 3: emerwen.webtomaster.DeleteWorkerRequest
	(*NewTargetRequest)(nil),    // 4: emerwen.webtomaster.NewTargetRequest
	(*PatchTargetRequest)(nil),  // 5: emerwen.webtomaster.PatchTargetRequest
	(*DeleteTargetRequest)(nil), // 6: emerwen.webtomaster.DeleteTargetRequest
	return file_coordinatorcontrol_proto_rawDescData
}

var file_coordinatorcontrol_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_coordinatorcontrol_proto_goTypes = []any{
	(*WorkersResponse)(nil),     // 0: emerwen.coordinatorcontrol.WorkersResponse
	(*NewWorkerRequest)(nil),    // 1: emerwen.coordinatorcontrol.NewWorkerRequest
	(*PatchWorkerRequest)(nil),  // 2: emerwen.coordinatorcontrol.PatchWorkerRequest
	(*DeleteWorkerRequest)(nil), // 3: emerwen.coordinatorcontrol.DeleteWorkerRequest
	(*NewTargetRequest)(nil),    // 4: emerwen.coordinatorcontrol.NewTargetRequest
	(*PatchTargetRequest)(nil),  // 5: emerwen.coordinatorcontrol.PatchTargetRequest
	(*DeleteTargetRequest)(nil), // 6: emerwen.coordinatorcontrol.DeleteTargetRequest
	(*shared.Worker)(nil),       // 7: emerwen.shared.Worker
	(*shared.MethodPing)(nil),   // 8: emerwen.shared.MethodPing
	(*shared.MethodGET)(nil),    // 9: emerwen.shared.MethodGET
	(*emptypb.Empty)(nil),       // 10: google.protobuf.Empty
}
var file_webtomaster_proto_depIdxs = []int32{
	7,  // 0: emerwen.webtomaster.WorkersResponse.workers:type_name -> emerwen.shared.Worker
	8,  // 1: emerwen.webtomaster.NewTargetRequest.ping:type_name -> emerwen.shared.MethodPing
	9,  // 2: emerwen.webtomaster.NewTargetRequest.get:type_name -> emerwen.shared.MethodGET
	8,  // 3: emerwen.webtomaster.PatchTargetRequest.ping:type_name -> emerwen.shared.MethodPing
	9,  // 4: emerwen.webtomaster.PatchTargetRequest.get:type_name -> emerwen.shared.MethodGET
	10, // 5: emerwen.webtomaster.WebToMaster.GetWorkers:input_type -> google.protobuf.Empty
	1,  // 6: emerwen.webtomaster.WebToMaster.NewWorker:input_type -> emerwen.webtomaster.NewWorkerRequest
	2,  // 7: emerwen.webtomaster.WebToMaster.PatchWorker:input_type -> emerwen.webtomaster.PatchWorkerRequest
	6,  // 8: emerwen.webtomaster.WebToMaster.DeleteTarget:input_type -> emerwen.webtomaster.DeleteTargetRequest
	4,  // 9: emerwen.webtomaster.WebToMaster.NewTarget:input_type -> emerwen.webtomaster.NewTargetRequest
	5,  // 10: emerwen.webtomaster.WebToMaster.PatchTarget:input_type -> emerwen.webtomaster.PatchTargetRequest
	3,  // 11: emerwen.webtomaster.WebToMaster.DeleteWorker:input_type -> emerwen.webtomaster.DeleteWorkerRequest
	0,  // 12: emerwen.webtomaster.WebToMaster.GetWorkers:output_type -> emerwen.webtomaster.WorkersResponse
	10, // 13: emerwen.webtomaster.WebToMaster.NewWorker:output_type -> google.protobuf.Empty
	10, // 14: emerwen.webtomaster.WebToMaster.PatchWorker:output_type -> google.protobuf.Empty
	10, // 15: emerwen.webtomaster.WebToMaster.DeleteTarget:output_type -> google.protobuf.Empty
	10, // 16: emerwen.webtomaster.WebToMaster.NewTarget:output_type -> google.protobuf.Empty
	10, // 17: emerwen.webtomaster.WebToMaster.PatchTarget:output_type -> google.protobuf.Empty
	10, // 18: emerwen.webtomaster.WebToMaster.DeleteWorker:output_type -> google.protobuf.Empty
	12, // [12:19] is the sub-list for method output_type
	5,  // [5:12] 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() }
func file_webtomaster_proto_init() {
	if File_webtomaster_proto != nil {
	(shared.Method)(0),          // 8: emerwen.shared.Method
	(*emptypb.Empty)(nil),       // 9: google.protobuf.Empty
}
var file_coordinatorcontrol_proto_depIdxs = []int32{
	7,  // 0: emerwen.coordinatorcontrol.WorkersResponse.workers:type_name -> emerwen.shared.Worker
	8,  // 1: emerwen.coordinatorcontrol.NewTargetRequest.method:type_name -> emerwen.shared.Method
	8,  // 2: emerwen.coordinatorcontrol.PatchTargetRequest.method:type_name -> emerwen.shared.Method
	9,  // 3: emerwen.coordinatorcontrol.CoordinatorControlService.GetWorkers:input_type -> google.protobuf.Empty
	1,  // 4: emerwen.coordinatorcontrol.CoordinatorControlService.NewWorker:input_type -> emerwen.coordinatorcontrol.NewWorkerRequest
	2,  // 5: emerwen.coordinatorcontrol.CoordinatorControlService.PatchWorker:input_type -> emerwen.coordinatorcontrol.PatchWorkerRequest
	6,  // 6: emerwen.coordinatorcontrol.CoordinatorControlService.DeleteTarget:input_type -> emerwen.coordinatorcontrol.DeleteTargetRequest
	4,  // 7: emerwen.coordinatorcontrol.CoordinatorControlService.NewTarget:input_type -> emerwen.coordinatorcontrol.NewTargetRequest
	5,  // 8: emerwen.coordinatorcontrol.CoordinatorControlService.PatchTarget:input_type -> emerwen.coordinatorcontrol.PatchTargetRequest
	3,  // 9: emerwen.coordinatorcontrol.CoordinatorControlService.DeleteWorker:input_type -> emerwen.coordinatorcontrol.DeleteWorkerRequest
	0,  // 10: emerwen.coordinatorcontrol.CoordinatorControlService.GetWorkers:output_type -> emerwen.coordinatorcontrol.WorkersResponse
	9,  // 11: emerwen.coordinatorcontrol.CoordinatorControlService.NewWorker:output_type -> google.protobuf.Empty
	9,  // 12: emerwen.coordinatorcontrol.CoordinatorControlService.PatchWorker:output_type -> google.protobuf.Empty
	9,  // 13: emerwen.coordinatorcontrol.CoordinatorControlService.DeleteTarget:output_type -> google.protobuf.Empty
	9,  // 14: emerwen.coordinatorcontrol.CoordinatorControlService.NewTarget:output_type -> google.protobuf.Empty
	9,  // 15: emerwen.coordinatorcontrol.CoordinatorControlService.PatchTarget:output_type -> google.protobuf.Empty
	9,  // 16: emerwen.coordinatorcontrol.CoordinatorControlService.DeleteWorker:output_type -> google.protobuf.Empty
	10, // [10:17] is the sub-list for method output_type
	3,  // [3:10] is the sub-list for method input_type
	3,  // [3:3] is the sub-list for extension type_name
	3,  // [3:3] is the sub-list for extension extendee
	0,  // [0:3] is the sub-list for field type_name
}

func init() { file_coordinatorcontrol_proto_init() }
func file_coordinatorcontrol_proto_init() {
	if File_coordinatorcontrol_proto != nil {
		return
	}
	file_webtomaster_proto_msgTypes[2].OneofWrappers = []any{}
	file_webtomaster_proto_msgTypes[4].OneofWrappers = []any{
		(*NewTargetRequest_Ping)(nil),
		(*NewTargetRequest_Get)(nil),
	}
	file_webtomaster_proto_msgTypes[5].OneofWrappers = []any{
		(*PatchTargetRequest_Ping)(nil),
		(*PatchTargetRequest_Get)(nil),
	}
	file_coordinatorcontrol_proto_msgTypes[2].OneofWrappers = []any{}
	file_coordinatorcontrol_proto_msgTypes[5].OneofWrappers = []any{}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_webtomaster_proto_rawDesc,
			RawDescriptor: file_coordinatorcontrol_proto_rawDesc,
			NumEnums:      0,
			NumMessages:   7,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_webtomaster_proto_goTypes,
		DependencyIndexes: file_webtomaster_proto_depIdxs,
		MessageInfos:      file_webtomaster_proto_msgTypes,
		GoTypes:           file_coordinatorcontrol_proto_goTypes,
		DependencyIndexes: file_coordinatorcontrol_proto_depIdxs,
		MessageInfos:      file_coordinatorcontrol_proto_msgTypes,
	}.Build()
	File_webtomaster_proto = out.File
	file_webtomaster_proto_rawDesc = nil
	file_webtomaster_proto_goTypes = nil
	file_webtomaster_proto_depIdxs = nil
	File_coordinatorcontrol_proto = out.File
	file_coordinatorcontrol_proto_rawDesc = nil
	file_coordinatorcontrol_proto_goTypes = nil
	file_coordinatorcontrol_proto_depIdxs = nil
}

R go/proto/webtomaster_grpc.pb.go => go/proto/coordinatorcontrol_grpc.pb.go +88 -87
@@ 2,7 2,7 @@
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v5.28.3
// source: webtomaster.proto
// source: coordinatorcontrol.proto

package proto



@@ 20,19 20,19 @@ import (
const _ = grpc.SupportPackageIsVersion7

const (
	WebToMaster_GetWorkers_FullMethodName   = "/emerwen.webtomaster.WebToMaster/GetWorkers"
	WebToMaster_NewWorker_FullMethodName    = "/emerwen.webtomaster.WebToMaster/NewWorker"
	WebToMaster_PatchWorker_FullMethodName  = "/emerwen.webtomaster.WebToMaster/PatchWorker"
	WebToMaster_DeleteTarget_FullMethodName = "/emerwen.webtomaster.WebToMaster/DeleteTarget"
	WebToMaster_NewTarget_FullMethodName    = "/emerwen.webtomaster.WebToMaster/NewTarget"
	WebToMaster_PatchTarget_FullMethodName  = "/emerwen.webtomaster.WebToMaster/PatchTarget"
	WebToMaster_DeleteWorker_FullMethodName = "/emerwen.webtomaster.WebToMaster/DeleteWorker"
	CoordinatorControlService_GetWorkers_FullMethodName   = "/emerwen.coordinatorcontrol.CoordinatorControlService/GetWorkers"
	CoordinatorControlService_NewWorker_FullMethodName    = "/emerwen.coordinatorcontrol.CoordinatorControlService/NewWorker"
	CoordinatorControlService_PatchWorker_FullMethodName  = "/emerwen.coordinatorcontrol.CoordinatorControlService/PatchWorker"
	CoordinatorControlService_DeleteTarget_FullMethodName = "/emerwen.coordinatorcontrol.CoordinatorControlService/DeleteTarget"
	CoordinatorControlService_NewTarget_FullMethodName    = "/emerwen.coordinatorcontrol.CoordinatorControlService/NewTarget"
	CoordinatorControlService_PatchTarget_FullMethodName  = "/emerwen.coordinatorcontrol.CoordinatorControlService/PatchTarget"
	CoordinatorControlService_DeleteWorker_FullMethodName = "/emerwen.coordinatorcontrol.CoordinatorControlService/DeleteWorker"
)

// WebToMasterClient is the client API for WebToMaster service.
// CoordinatorControlServiceClient is the client API for CoordinatorControlService service.
//
// 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 {
type CoordinatorControlServiceClient interface {
	GetWorkers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*WorkersResponse, error)
	NewWorker(ctx context.Context, in *NewWorkerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	PatchWorker(ctx context.Context, in *PatchWorkerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)


@@ 42,81 42,81 @@ type WebToMasterClient interface {
	DeleteWorker(ctx context.Context, in *DeleteWorkerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

type webToMasterClient struct {
type coordinatorControlServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewWebToMasterClient(cc grpc.ClientConnInterface) WebToMasterClient {
	return &webToMasterClient{cc}
func NewCoordinatorControlServiceClient(cc grpc.ClientConnInterface) CoordinatorControlServiceClient {
	return &coordinatorControlServiceClient{cc}
}

func (c *webToMasterClient) GetWorkers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*WorkersResponse, error) {
func (c *coordinatorControlServiceClient) GetWorkers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*WorkersResponse, error) {
	out := new(WorkersResponse)
	err := c.cc.Invoke(ctx, WebToMaster_GetWorkers_FullMethodName, in, out, opts...)
	err := c.cc.Invoke(ctx, CoordinatorControlService_GetWorkers_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *webToMasterClient) NewWorker(ctx context.Context, in *NewWorkerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
func (c *coordinatorControlServiceClient) NewWorker(ctx context.Context, in *NewWorkerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, WebToMaster_NewWorker_FullMethodName, in, out, opts...)
	err := c.cc.Invoke(ctx, CoordinatorControlService_NewWorker_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) (*emptypb.Empty, error) {
func (c *coordinatorControlServiceClient) PatchWorker(ctx context.Context, in *PatchWorkerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, WebToMaster_PatchWorker_FullMethodName, in, out, opts...)
	err := c.cc.Invoke(ctx, CoordinatorControlService_PatchWorker_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *webToMasterClient) DeleteTarget(ctx context.Context, in *DeleteTargetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
func (c *coordinatorControlServiceClient) DeleteTarget(ctx context.Context, in *DeleteTargetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, WebToMaster_DeleteTarget_FullMethodName, in, out, opts...)
	err := c.cc.Invoke(ctx, CoordinatorControlService_DeleteTarget_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) (*emptypb.Empty, error) {
func (c *coordinatorControlServiceClient) NewTarget(ctx context.Context, in *NewTargetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, WebToMaster_NewTarget_FullMethodName, in, out, opts...)
	err := c.cc.Invoke(ctx, CoordinatorControlService_NewTarget_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) (*emptypb.Empty, error) {
func (c *coordinatorControlServiceClient) PatchTarget(ctx context.Context, in *PatchTargetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, WebToMaster_PatchTarget_FullMethodName, in, out, opts...)
	err := c.cc.Invoke(ctx, CoordinatorControlService_PatchTarget_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *webToMasterClient) DeleteWorker(ctx context.Context, in *DeleteWorkerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
func (c *coordinatorControlServiceClient) DeleteWorker(ctx context.Context, in *DeleteWorkerRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
	out := new(emptypb.Empty)
	err := c.cc.Invoke(ctx, WebToMaster_DeleteWorker_FullMethodName, in, out, opts...)
	err := c.cc.Invoke(ctx, CoordinatorControlService_DeleteWorker_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
// CoordinatorControlServiceServer is the server API for CoordinatorControlService service.
// All implementations must embed UnimplementedCoordinatorControlServiceServer
// for forward compatibility
type WebToMasterServer interface {
type CoordinatorControlServiceServer interface {
	GetWorkers(context.Context, *emptypb.Empty) (*WorkersResponse, error)
	NewWorker(context.Context, *NewWorkerRequest) (*emptypb.Empty, error)
	PatchWorker(context.Context, *PatchWorkerRequest) (*emptypb.Empty, error)


@@ 124,209 124,210 @@ type WebToMasterServer interface {
	NewTarget(context.Context, *NewTargetRequest) (*emptypb.Empty, error)
	PatchTarget(context.Context, *PatchTargetRequest) (*emptypb.Empty, error)
	DeleteWorker(context.Context, *DeleteWorkerRequest) (*emptypb.Empty, error)
	mustEmbedUnimplementedWebToMasterServer()
	mustEmbedUnimplementedCoordinatorControlServiceServer()
}

// UnimplementedWebToMasterServer must be embedded to have forward compatible implementations.
type UnimplementedWebToMasterServer struct {
// UnimplementedCoordinatorControlServiceServer must be embedded to have forward compatible implementations.
type UnimplementedCoordinatorControlServiceServer struct {
}

func (UnimplementedWebToMasterServer) GetWorkers(context.Context, *emptypb.Empty) (*WorkersResponse, error) {
func (UnimplementedCoordinatorControlServiceServer) GetWorkers(context.Context, *emptypb.Empty) (*WorkersResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetWorkers not implemented")
}
func (UnimplementedWebToMasterServer) NewWorker(context.Context, *NewWorkerRequest) (*emptypb.Empty, error) {
func (UnimplementedCoordinatorControlServiceServer) NewWorker(context.Context, *NewWorkerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method NewWorker not implemented")
}
func (UnimplementedWebToMasterServer) PatchWorker(context.Context, *PatchWorkerRequest) (*emptypb.Empty, error) {
func (UnimplementedCoordinatorControlServiceServer) PatchWorker(context.Context, *PatchWorkerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PatchWorker not implemented")
}
func (UnimplementedWebToMasterServer) DeleteTarget(context.Context, *DeleteTargetRequest) (*emptypb.Empty, error) {
func (UnimplementedCoordinatorControlServiceServer) DeleteTarget(context.Context, *DeleteTargetRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteTarget not implemented")
}
func (UnimplementedWebToMasterServer) NewTarget(context.Context, *NewTargetRequest) (*emptypb.Empty, error) {
func (UnimplementedCoordinatorControlServiceServer) NewTarget(context.Context, *NewTargetRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method NewTarget not implemented")
}
func (UnimplementedWebToMasterServer) PatchTarget(context.Context, *PatchTargetRequest) (*emptypb.Empty, error) {
func (UnimplementedCoordinatorControlServiceServer) PatchTarget(context.Context, *PatchTargetRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PatchTarget not implemented")
}
func (UnimplementedWebToMasterServer) DeleteWorker(context.Context, *DeleteWorkerRequest) (*emptypb.Empty, error) {
func (UnimplementedCoordinatorControlServiceServer) DeleteWorker(context.Context, *DeleteWorkerRequest) (*emptypb.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteWorker not implemented")
}
func (UnimplementedWebToMasterServer) mustEmbedUnimplementedWebToMasterServer() {}
func (UnimplementedCoordinatorControlServiceServer) mustEmbedUnimplementedCoordinatorControlServiceServer() {
}

// UnsafeWebToMasterServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WebToMasterServer will
// UnsafeCoordinatorControlServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CoordinatorControlServiceServer will
// result in compilation errors.
type UnsafeWebToMasterServer interface {
	mustEmbedUnimplementedWebToMasterServer()
type UnsafeCoordinatorControlServiceServer interface {
	mustEmbedUnimplementedCoordinatorControlServiceServer()
}

func RegisterWebToMasterServer(s grpc.ServiceRegistrar, srv WebToMasterServer) {
	s.RegisterService(&WebToMaster_ServiceDesc, srv)
func RegisterCoordinatorControlServiceServer(s grpc.ServiceRegistrar, srv CoordinatorControlServiceServer) {
	s.RegisterService(&CoordinatorControlService_ServiceDesc, srv)
}

func _WebToMaster_GetWorkers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _CoordinatorControlService_GetWorkers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(WebToMasterServer).GetWorkers(ctx, in)
		return srv.(CoordinatorControlServiceServer).GetWorkers(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WebToMaster_GetWorkers_FullMethodName,
		FullMethod: CoordinatorControlService_GetWorkers_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WebToMasterServer).GetWorkers(ctx, req.(*emptypb.Empty))
		return srv.(CoordinatorControlServiceServer).GetWorkers(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _WebToMaster_NewWorker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _CoordinatorControlService_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)
		return srv.(CoordinatorControlServiceServer).NewWorker(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WebToMaster_NewWorker_FullMethodName,
		FullMethod: CoordinatorControlService_NewWorker_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WebToMasterServer).NewWorker(ctx, req.(*NewWorkerRequest))
		return srv.(CoordinatorControlServiceServer).NewWorker(ctx, req.(*NewWorkerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _WebToMaster_PatchWorker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _CoordinatorControlService_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)
		return srv.(CoordinatorControlServiceServer).PatchWorker(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WebToMaster_PatchWorker_FullMethodName,
		FullMethod: CoordinatorControlService_PatchWorker_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WebToMasterServer).PatchWorker(ctx, req.(*PatchWorkerRequest))
		return srv.(CoordinatorControlServiceServer).PatchWorker(ctx, req.(*PatchWorkerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _WebToMaster_DeleteTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _CoordinatorControlService_DeleteTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteTargetRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(WebToMasterServer).DeleteTarget(ctx, in)
		return srv.(CoordinatorControlServiceServer).DeleteTarget(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WebToMaster_DeleteTarget_FullMethodName,
		FullMethod: CoordinatorControlService_DeleteTarget_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WebToMasterServer).DeleteTarget(ctx, req.(*DeleteTargetRequest))
		return srv.(CoordinatorControlServiceServer).DeleteTarget(ctx, req.(*DeleteTargetRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _WebToMaster_NewTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _CoordinatorControlService_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)
		return srv.(CoordinatorControlServiceServer).NewTarget(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WebToMaster_NewTarget_FullMethodName,
		FullMethod: CoordinatorControlService_NewTarget_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WebToMasterServer).NewTarget(ctx, req.(*NewTargetRequest))
		return srv.(CoordinatorControlServiceServer).NewTarget(ctx, req.(*NewTargetRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _WebToMaster_PatchTarget_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _CoordinatorControlService_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)
		return srv.(CoordinatorControlServiceServer).PatchTarget(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WebToMaster_PatchTarget_FullMethodName,
		FullMethod: CoordinatorControlService_PatchTarget_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WebToMasterServer).PatchTarget(ctx, req.(*PatchTargetRequest))
		return srv.(CoordinatorControlServiceServer).PatchTarget(ctx, req.(*PatchTargetRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _WebToMaster_DeleteWorker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _CoordinatorControlService_DeleteWorker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteWorkerRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(WebToMasterServer).DeleteWorker(ctx, in)
		return srv.(CoordinatorControlServiceServer).DeleteWorker(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: WebToMaster_DeleteWorker_FullMethodName,
		FullMethod: CoordinatorControlService_DeleteWorker_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(WebToMasterServer).DeleteWorker(ctx, req.(*DeleteWorkerRequest))
		return srv.(CoordinatorControlServiceServer).DeleteWorker(ctx, req.(*DeleteWorkerRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// WebToMaster_ServiceDesc is the grpc.ServiceDesc for WebToMaster service.
// CoordinatorControlService_ServiceDesc is the grpc.ServiceDesc for CoordinatorControlService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WebToMaster_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "emerwen.webtomaster.WebToMaster",
	HandlerType: (*WebToMasterServer)(nil),
var CoordinatorControlService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "emerwen.coordinatorcontrol.CoordinatorControlService",
	HandlerType: (*CoordinatorControlServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetWorkers",
			Handler:    _WebToMaster_GetWorkers_Handler,
			Handler:    _CoordinatorControlService_GetWorkers_Handler,
		},
		{
			MethodName: "NewWorker",
			Handler:    _WebToMaster_NewWorker_Handler,
			Handler:    _CoordinatorControlService_NewWorker_Handler,
		},
		{
			MethodName: "PatchWorker",
			Handler:    _WebToMaster_PatchWorker_Handler,
			Handler:    _CoordinatorControlService_PatchWorker_Handler,
		},
		{
			MethodName: "DeleteTarget",
			Handler:    _WebToMaster_DeleteTarget_Handler,
			Handler:    _CoordinatorControlService_DeleteTarget_Handler,
		},
		{
			MethodName: "NewTarget",
			Handler:    _WebToMaster_NewTarget_Handler,
			Handler:    _CoordinatorControlService_NewTarget_Handler,
		},
		{
			MethodName: "PatchTarget",
			Handler:    _WebToMaster_PatchTarget_Handler,
			Handler:    _CoordinatorControlService_PatchTarget_Handler,
		},
		{
			MethodName: "DeleteWorker",
			Handler:    _WebToMaster_DeleteWorker_Handler,
			Handler:    _CoordinatorControlService_DeleteWorker_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "webtomaster.proto",
	Metadata: "coordinatorcontrol.proto",
}

M go/proto/shared/target.pb.go => go/proto/shared/target.pb.go +95 -165
@@ 20,6 20,52 @@ const (
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type Method int32

const (
	Method_PING Method = 0
	Method_GET  Method = 1
)

// Enum value maps for Method.
var (
	Method_name = map[int32]string{
		0: "PING",
		1: "GET",
	}
	Method_value = map[string]int32{
		"PING": 0,
		"GET":  1,
	}
)

func (x Method) Enum() *Method {
	p := new(Method)
	*p = x
	return p
}

func (x Method) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (Method) Descriptor() protoreflect.EnumDescriptor {
	return file_shared_target_proto_enumTypes[0].Descriptor()
}

func (Method) Type() protoreflect.EnumType {
	return &file_shared_target_proto_enumTypes[0]
}

func (x Method) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use Method.Descriptor instead.
func (Method) EnumDescriptor() ([]byte, []int) {
	return file_shared_target_proto_rawDescGZIP(), []int{0}
}

type TargetState int32

const (


@@ 53,11 99,11 @@ func (x TargetState) String() string {
}

func (TargetState) Descriptor() protoreflect.EnumDescriptor {
	return file_shared_target_proto_enumTypes[0].Descriptor()
	return file_shared_target_proto_enumTypes[1].Descriptor()
}

func (TargetState) Type() protoreflect.EnumType {
	return &file_shared_target_proto_enumTypes[0]
	return &file_shared_target_proto_enumTypes[1]
}

func (x TargetState) Number() protoreflect.EnumNumber {


@@ 66,7 112,7 @@ func (x TargetState) Number() protoreflect.EnumNumber {

// Deprecated: Use TargetState.Descriptor instead.
func (TargetState) EnumDescriptor() ([]byte, []int) {
	return file_shared_target_proto_rawDescGZIP(), []int{0}
	return file_shared_target_proto_rawDescGZIP(), []int{1}
}

type Target struct {


@@ 74,15 120,12 @@ type Target struct {
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Addr     string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
	Interval int32  `protobuf:"varint,3,opt,name=interval,proto3" json:"interval,omitempty"`
	// Types that are assignable to Method:
	//
	//	*Target_Ping
	//	*Target_Get
	Method isTarget_Method `protobuf_oneof:"method"`
	Name   string          `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"`
	TargetId string  `protobuf:"bytes,1,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"`
	Addr     string  `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
	Interval int32   `protobuf:"varint,3,opt,name=interval,proto3" json:"interval,omitempty"`
	Name     string  `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	Method   Method  `protobuf:"varint,5,opt,name=method,proto3,enum=emerwen.shared.Method" json:"method,omitempty"`
	OkCodes  []int32 `protobuf:"varint,6,rep,packed,name=ok_codes,json=okCodes,proto3" json:"ok_codes,omitempty"`
}

func (x *Target) Reset() {


@@ 115,9 158,9 @@ func (*Target) Descriptor() ([]byte, []int) {
	return file_shared_target_proto_rawDescGZIP(), []int{0}
}

func (x *Target) GetId() string {
func (x *Target) GetTargetId() string {
	if x != nil {
		return x.Id
		return x.TargetId
	}
	return ""
}


@@ 136,27 179,6 @@ func (x *Target) GetInterval() int32 {
	return 0
}

func (m *Target) GetMethod() isTarget_Method {
	if m != nil {
		return m.Method
	}
	return nil
}

func (x *Target) GetPing() *MethodPing {
	if x, ok := x.GetMethod().(*Target_Ping); ok {
		return x.Ping
	}
	return nil
}

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


@@ 164,97 186,14 @@ func (x *Target) GetName() string {
	return ""
}

type isTarget_Method interface {
	isTarget_Method()
}

type Target_Ping struct {
	Ping *MethodPing `protobuf:"bytes,4,opt,name=ping,proto3,oneof"`
}

type Target_Get struct {
	Get *MethodGET `protobuf:"bytes,5,opt,name=get,proto3,oneof"`
}

func (*Target_Ping) isTarget_Method() {}

func (*Target_Get) isTarget_Method() {}

type MethodPing struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields
}

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 *MethodPing) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*MethodPing) ProtoMessage() {}

func (x *MethodPing) ProtoReflect() protoreflect.Message {
	mi := &file_shared_target_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 MethodPing.ProtoReflect.Descriptor instead.
func (*MethodPing) Descriptor() ([]byte, []int) {
	return file_shared_target_proto_rawDescGZIP(), []int{1}
}

type MethodGET struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	OkCodes []int32 `protobuf:"varint,1,rep,packed,name=ok_codes,json=okCodes,proto3" json:"ok_codes,omitempty"`
}

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 *MethodGET) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*MethodGET) ProtoMessage() {}

func (x *MethodGET) ProtoReflect() protoreflect.Message {
	mi := &file_shared_target_proto_msgTypes[2]
func (x *Target) GetMethod() Method {
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
		return x.Method
	}
	return mi.MessageOf(x)
	return Method_PING
}

// Deprecated: Use MethodGET.ProtoReflect.Descriptor instead.
func (*MethodGET) Descriptor() ([]byte, []int) {
	return file_shared_target_proto_rawDescGZIP(), []int{2}
}

func (x *MethodGET) GetOkCodes() []int32 {
func (x *Target) GetOkCodes() []int32 {
	if x != nil {
		return x.OkCodes
	}


@@ 266,30 205,27 @@ 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, 0xc7, 0x01, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
	0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,
	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, 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, 0x05, 0x52, 0x07, 0x6f, 0x6b,
	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,
	0x68, 0x61, 0x72, 0x65, 0x64, 0x22, 0xb4, 0x01, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
	0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
	0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 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, 0x05, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x12, 0x12, 0x0a,
	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
	0x65, 0x12, 0x2e, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28,
	0x0e, 0x32, 0x16, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72,
	0x65, 0x64, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f,
	0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x6b, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x06, 0x20,
	0x03, 0x28, 0x05, 0x52, 0x07, 0x6f, 0x6b, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x2a, 0x1b, 0x0a, 0x06,
	0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x49, 0x4e, 0x47, 0x10, 0x00,
	0x12, 0x07, 0x0a, 0x03, 0x47, 0x45, 0x54, 0x10, 0x01, 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 (


@@ 304,22 240,20 @@ func file_shared_target_proto_rawDescGZIP() []byte {
	return file_shared_target_proto_rawDescData
}

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_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_shared_target_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_shared_target_proto_goTypes = []any{
	(TargetState)(0),   // 0: emerwen.shared.TargetState
	(*Target)(nil),     // 1: emerwen.shared.Target
	(*MethodPing)(nil), // 2: emerwen.shared.MethodPing
	(*MethodGET)(nil),  // 3: emerwen.shared.MethodGET
	(Method)(0),      // 0: emerwen.shared.Method
	(TargetState)(0), // 1: emerwen.shared.TargetState
	(*Target)(nil),   // 2: emerwen.shared.Target
}
var file_shared_target_proto_depIdxs = []int32{
	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
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
	0, // 0: emerwen.shared.Target.method:type_name -> emerwen.shared.Method
	1, // [1:1] is the sub-list for method output_type
	1, // [1:1] 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_shared_target_proto_init() }


@@ 327,17 261,13 @@ func file_shared_target_proto_init() {
	if File_shared_target_proto != nil {
		return
	}
	file_shared_target_proto_msgTypes[0].OneofWrappers = []any{
		(*Target_Ping)(nil),
		(*Target_Get)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_shared_target_proto_rawDesc,
			NumEnums:      1,
			NumMessages:   3,
			NumEnums:      2,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},

M go/proto/shared/worker.pb.go => go/proto/shared/worker.pb.go +27 -26
@@ 25,10 25,10 @@ type Worker struct {
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	Id        string    `protobuf:"bytes,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"`
	WorkerId  string    `protobuf:"bytes,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,omitempty"`
	Name      string    `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	AuthToken string    `protobuf:"bytes,3,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"`
	Targets   []*Target `protobuf:"bytes,4,rep,name=targets,proto3" json:"targets,omitempty"`
}

func (x *Worker) Reset() {


@@ 61,9 61,16 @@ func (*Worker) Descriptor() ([]byte, []int) {
	return file_shared_worker_proto_rawDescGZIP(), []int{0}
}

func (x *Worker) GetId() string {
func (x *Worker) GetWorkerId() string {
	if x != nil {
		return x.Id
		return x.WorkerId
	}
	return ""
}

func (x *Worker) GetName() string {
	if x != nil {
		return x.Name
	}
	return ""
}


@@ 82,32 89,26 @@ 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, 0x7d, 0x0a, 0x06, 0x57, 0x6f,
	0x72, 0x6b, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
	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, 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,
	0x72, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x06, 0x57,
	0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x5f,
	0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x1d, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x74,
	0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 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, 0x04, 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,
}

var (

M justfile => justfile +1 -1
@@ 5,7 5,7 @@ go-compile-protos:
    protoc --go_out=go/proto --go_opt=paths=source_relative \
        --go-grpc_out=go/proto --go-grpc_opt=paths=source_relative \
        --proto_path=proto \
        proto/webtomaster.proto proto/shared/target.proto proto/shared/worker.proto
        proto/coordinatorcontrol.proto proto/shared/target.proto proto/shared/worker.proto

rust-test:
    cargo test

R proto/webtomaster.proto => proto/coordinatorcontrol.proto +6 -10
@@ 1,5 1,5 @@
syntax = "proto3";
package emerwen.webtomaster;
package emerwen.coordinatorcontrol;

option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto";



@@ 7,7 7,7 @@ import "google/protobuf/empty.proto";
import "shared/target.proto";
import "shared/worker.proto";

service WebToMaster {
service CoordinatorControlService {
    rpc GetWorkers (google.protobuf.Empty) returns (WorkersResponse);
    rpc NewWorker (NewWorkerRequest) returns (google.protobuf.Empty);
    rpc PatchWorker (PatchWorkerRequest) returns (google.protobuf.Empty);


@@ 39,10 39,8 @@ message NewTargetRequest {
    string name = 2;
    string addr = 3;
    int32 interval = 4;
    oneof method {
        shared.MethodPing ping = 5;
        shared.MethodGET get = 6;
    }
    shared.Method method = 5;
    repeated int32 ok_codes = 6;
}

message PatchTargetRequest {


@@ 50,10 48,8 @@ message PatchTargetRequest {
    optional string name = 2;
    optional string addr = 3;
    optional int32 interval = 4;
    oneof method {
        shared.MethodPing ping = 5;
        shared.MethodGET get = 6;
    }
    optional shared.Method method = 5;
    repeated int32 ok_codes = 6;
}

message DeleteTargetRequest {

M proto/shared/target.proto => proto/shared/target.proto +7 -10
@@ 4,20 4,17 @@ package emerwen.shared;
option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto/shared";

message Target {
    string id = 1;
    string target_id = 1;
    string addr = 2;
    int32 interval = 3;
    oneof method {
        MethodPing ping = 4;
        MethodGET get = 5;
    }
    string name = 6;
    string name = 4;
    Method method = 5;
    repeated int32 ok_codes = 6;
}

message MethodPing {}

message MethodGET {
    repeated int32 ok_codes = 1;
enum Method {
    PING = 0;
    GET = 1;
}

enum TargetState {

M proto/shared/worker.proto => proto/shared/worker.proto +4 -4
@@ 6,8 6,8 @@ option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto/shared";
import "shared/target.proto";

message Worker {
    string id = 1;
    string auth_token = 2;
    repeated shared.Target targets = 3;
    string name = 4;
    string worker_id = 1;
    string name = 2;
    string auth_token = 3;
    repeated shared.Target targets = 4;
}

A proto/workercontrol.proto => proto/workercontrol.proto +29 -0
@@ 0,0 1,29 @@
syntax = "proto3";
package emerwen.workercontrol;

import "shared/target.proto";

service WorkerControlService {
    rpc WorkerStream(stream WorkerMessage) returns (stream ServerCommand) {}
}

message WorkerMessage {
    oneof msg {
        TargetStateMessage target_state = 1;
    }
}

message TargetStateMessage {
    string target_id = 1;
    shared.TargetState state = 2;
}

message ServerCommand {
    oneof cmd {
        TargetsCommand targets = 1;
    }
}

message TargetsCommand {
    repeated shared.Target targets = 1;
}

D proto/workertomaster.proto => proto/workertomaster.proto +0 -19
@@ 1,19 0,0 @@
syntax = "proto3";
package emerwen.workertomaster;

import "google/protobuf/empty.proto";
import "shared/target.proto";

service WorkerToMaster {
    rpc GetTargets (google.protobuf.Empty) returns (TargetsResponse);
    rpc SetTargetState (SetTargetStateRequest) returns (google.protobuf.Empty);
}

message TargetsResponse {
    repeated shared.Target targets = 1;
}

message SetTargetStateRequest {
    string id = 1;
    shared.TargetState state = 2;
}

M rust/emerwen-proto/build.rs => rust/emerwen-proto/build.rs +2 -24
@@ 1,32 1,10 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
    tonic_build::configure()
        .include_file("mod.rs")
        .type_attribute("Target", "#[derive(serde::Deserialize, serde::Serialize)]")
        .type_attribute(
            "Target.method",
            "#[derive(serde::Deserialize, serde::Serialize)]",
        )
        .type_attribute(
            "NewTargetRequest.method",
            "#[derive(serde::Deserialize, serde::Serialize)]",
        )
        .type_attribute(
            "PatchTargetRequest.method",
            "#[derive(serde::Deserialize, serde::Serialize)]",
        )
        .type_attribute(
            "MethodPing",
            "#[derive(serde::Deserialize, serde::Serialize)]",
        )
        .type_attribute(
            "MethodGET",
            "#[derive(serde::Deserialize, serde::Serialize)]",
        )
        .type_attribute("Worker", "#[derive(serde::Deserialize, serde::Serialize)]")
        .compile_protos(
            &[
                "../../proto/workertomaster.proto",
                "../../proto/webtomaster.proto",
                "../../proto/coordinatorcontrol.proto",
                "../../proto/workercontrol.proto",
                "../../proto/shared/target.proto",
                "../../proto/shared/worker.proto",
            ],

M rust/emerwen-proto/src/lib.rs => rust/emerwen-proto/src/lib.rs +0 -14
@@ 6,17 6,3 @@
 */

tonic::include_proto!("mod");

use emerwen::shared::{target::Method, MethodGet, MethodPing};

impl From<MethodPing> for Method {
    fn from(value: MethodPing) -> Self {
        Method::Ping(value)
    }
}

impl From<MethodGet> for Method {
    fn from(value: MethodGet) -> Self {
        Method::Get(value)
    }
}