From 9edfaafb0937f0cc7ba4cb3302b859a83bf34f1b Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Tue, 19 Nov 2024 14:50:09 +0200 Subject: [PATCH] feat!: swap integer ids for strings --- go/proto/shared/target.pb.go | 8 ++++---- go/proto/shared/worker.pb.go | 8 ++++---- go/proto/webtomaster.pb.go | 8 ++++---- proto/shared/target.proto | 2 +- proto/shared/worker.proto | 2 +- proto/webtomaster.proto | 2 +- proto/workertomaster.proto | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/go/proto/shared/target.pb.go b/go/proto/shared/target.pb.go index 1ddbd13..d36e67d 100644 --- a/go/proto/shared/target.pb.go +++ b/go/proto/shared/target.pb.go @@ -74,7 +74,7 @@ type Target struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + 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 uint32 `protobuf:"varint,3,opt,name=interval,proto3" json:"interval,omitempty"` // Types that are assignable to Method: @@ -115,11 +115,11 @@ func (*Target) Descriptor() ([]byte, []int) { return file_shared_target_proto_rawDescGZIP(), []int{0} } -func (x *Target) GetId() uint32 { +func (x *Target) GetId() string { if x != nil { return x.Id } - return 0 + return "" } func (x *Target) GetAddr() string { @@ -267,7 +267,7 @@ 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, 0x0d, 0x52, 0x02, 0x69, 0x64, + 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, 0x0d, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, diff --git a/go/proto/shared/worker.pb.go b/go/proto/shared/worker.pb.go index 89bf4a5..c86a2f0 100644 --- a/go/proto/shared/worker.pb.go +++ b/go/proto/shared/worker.pb.go @@ -25,7 +25,7 @@ type Worker struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + 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"` @@ -61,11 +61,11 @@ func (*Worker) Descriptor() ([]byte, []int) { return file_shared_worker_proto_rawDescGZIP(), []int{0} } -func (x *Worker) GetId() uint32 { +func (x *Worker) GetId() string { if x != nil { return x.Id } - return 0 + return "" } func (x *Worker) GetAuthToken() string { @@ -96,7 +96,7 @@ var file_shared_worker_proto_rawDesc = []byte{ 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, 0x0d, + 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, diff --git a/go/proto/webtomaster.pb.go b/go/proto/webtomaster.pb.go index 3c8394f..1f1f6c7 100644 --- a/go/proto/webtomaster.pb.go +++ b/go/proto/webtomaster.pb.go @@ -162,7 +162,7 @@ type NewTargetRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - WorkerId uint32 `protobuf:"varint,1,opt,name=worker_id,json=workerId,proto3" json:"worker_id,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"` Addr string `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"` Interval uint32 `protobuf:"varint,4,opt,name=interval,proto3" json:"interval,omitempty"` @@ -203,11 +203,11 @@ func (*NewTargetRequest) Descriptor() ([]byte, []int) { return file_webtomaster_proto_rawDescGZIP(), []int{3} } -func (x *NewTargetRequest) GetWorkerId() uint32 { +func (x *NewTargetRequest) GetWorkerId() string { if x != nil { return x.WorkerId } - return 0 + return "" } func (x *NewTargetRequest) GetName() string { @@ -573,7 +573,7 @@ var file_webtomaster_proto_rawDesc = []byte{ 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, + 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, diff --git a/proto/shared/target.proto b/proto/shared/target.proto index 7b79da8..116ed9c 100644 --- a/proto/shared/target.proto +++ b/proto/shared/target.proto @@ -4,7 +4,7 @@ package emerwen.shared; option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto/shared"; message Target { - uint32 id = 1; + string id = 1; string addr = 2; uint32 interval = 3; oneof method { diff --git a/proto/shared/worker.proto b/proto/shared/worker.proto index acf7d97..6f60a6a 100644 --- a/proto/shared/worker.proto +++ b/proto/shared/worker.proto @@ -6,7 +6,7 @@ option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto/shared"; import "shared/target.proto"; message Worker { - uint32 id = 1; + string 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 831bcf2..852ab51 100644 --- a/proto/webtomaster.proto +++ b/proto/webtomaster.proto @@ -28,7 +28,7 @@ message NewWorkerResponse { } message NewTargetRequest { - uint32 worker_id = 1; + string worker_id = 1; string name = 2; string addr = 3; uint32 interval = 4; diff --git a/proto/workertomaster.proto b/proto/workertomaster.proto index ac6aa65..95d0152 100644 --- a/proto/workertomaster.proto +++ b/proto/workertomaster.proto @@ -14,6 +14,6 @@ message TargetsResponse { } message SetTargetStateRequest { - uint32 id = 1; + string id = 1; shared.TargetState state = 2; } -- 2.44.1