From 06cafd5cb729e9dceb80e337dcd404ca9ccd6874 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Mon, 18 Nov 2024 09:48:47 +0200 Subject: [PATCH] fix: go package naming --- go/{ => proto}/shared/target.pb.go | 10 +++++----- go/{ => proto}/shared/worker.pb.go | 21 +++++++++++---------- go/{ => proto}/webtomaster.pb.go | 15 ++++++++------- go/{ => proto}/webtomaster_grpc.pb.go | 2 +- justfile | 4 ++-- proto/shared/target.proto | 2 +- proto/shared/worker.proto | 2 +- proto/webtomaster.proto | 2 +- 8 files changed, 30 insertions(+), 28 deletions(-) rename go/{ => proto}/shared/target.pb.go (97%) rename go/{ => proto}/shared/worker.pb.go (87%) rename go/{ => proto}/webtomaster.pb.go (93%) rename go/{ => proto}/webtomaster_grpc.pb.go (99%) diff --git a/go/shared/target.pb.go b/go/proto/shared/target.pb.go similarity index 97% rename from go/shared/target.pb.go rename to go/proto/shared/target.pb.go index c4f34d9..2491f19 100644 --- a/go/shared/target.pb.go +++ b/go/proto/shared/target.pb.go @@ -4,7 +4,7 @@ // protoc v5.28.3 // source: shared/target.proto -package target +package shared import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -276,11 +276,11 @@ var file_shared_target_proto_rawDesc = []byte{ 0x43, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2a, 0x2c, 0x0a, 0x0b, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x55, 0x50, 0x10, 0x01, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x42, 0x30, 0x5a, - 0x2e, 0x67, 0x69, 0x74, 0x2e, 0x73, 0x72, 0x63, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2f, 0x7e, + 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, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/go/shared/worker.pb.go b/go/proto/shared/worker.pb.go similarity index 87% rename from go/shared/worker.pb.go rename to go/proto/shared/worker.pb.go index 3eb77ea..ea4d198 100644 --- a/go/shared/worker.pb.go +++ b/go/proto/shared/worker.pb.go @@ -4,10 +4,9 @@ // protoc v5.28.3 // source: shared/worker.proto -package worker +package shared import ( - target "git.src.quest/~liljamo/emerwen-proto/go/target" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -26,9 +25,9 @@ type Worker struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - AuthToken string `protobuf:"bytes,2,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"` - Targets []*target.Target `protobuf:"bytes,3,rep,name=targets,proto3" json:"targets,omitempty"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + AuthToken string `protobuf:"bytes,2,opt,name=auth_token,json=authToken,proto3" json:"auth_token,omitempty"` + Targets []*Target `protobuf:"bytes,3,rep,name=targets,proto3" json:"targets,omitempty"` } func (x *Worker) Reset() { @@ -75,7 +74,7 @@ func (x *Worker) GetAuthToken() string { return "" } -func (x *Worker) GetTargets() []*target.Target { +func (x *Worker) GetTargets() []*Target { if x != nil { return x.Targets } @@ -95,10 +94,11 @@ var file_shared_worker_proto_rawDesc = []byte{ 0x6b, 0x65, 0x6e, 0x12, 0x30, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x07, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x73, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x2e, 0x73, 0x72, 0x63, + 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, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -115,8 +115,8 @@ func file_shared_worker_proto_rawDescGZIP() []byte { var file_shared_worker_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_shared_worker_proto_goTypes = []any{ - (*Worker)(nil), // 0: emerwen.shared.Worker - (*target.Target)(nil), // 1: emerwen.shared.Target + (*Worker)(nil), // 0: emerwen.shared.Worker + (*Target)(nil), // 1: emerwen.shared.Target } var file_shared_worker_proto_depIdxs = []int32{ 1, // 0: emerwen.shared.Worker.targets:type_name -> emerwen.shared.Target @@ -132,6 +132,7 @@ func file_shared_worker_proto_init() { if File_shared_worker_proto != nil { return } + file_shared_target_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/go/webtomaster.pb.go b/go/proto/webtomaster.pb.go similarity index 93% rename from go/webtomaster.pb.go rename to go/proto/webtomaster.pb.go index 33b498f..02e7500 100644 --- a/go/webtomaster.pb.go +++ b/go/proto/webtomaster.pb.go @@ -4,10 +4,10 @@ // protoc v5.28.3 // source: webtomaster.proto -package _go +package proto import ( - worker "git.src.quest/~liljamo/emerwen-proto/go/worker" + shared "git.src.quest/~liljamo/emerwen-proto/go/proto/shared" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" @@ -27,7 +27,7 @@ type WorkersResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Workers []*worker.Worker `protobuf:"bytes,1,rep,name=workers,proto3" json:"workers,omitempty"` + Workers []*shared.Worker `protobuf:"bytes,1,rep,name=workers,proto3" json:"workers,omitempty"` } func (x *WorkersResponse) Reset() { @@ -60,7 +60,7 @@ func (*WorkersResponse) Descriptor() ([]byte, []int) { return file_webtomaster_proto_rawDescGZIP(), []int{0} } -func (x *WorkersResponse) GetWorkers() []*worker.Worker { +func (x *WorkersResponse) GetWorkers() []*shared.Worker { if x != nil { return x.Workers } @@ -85,10 +85,11 @@ var file_webtomaster_proto_rawDesc = []byte{ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x24, 0x2e, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2e, 0x77, 0x65, 0x62, 0x74, 0x6f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x29, 0x5a, 0x27, 0x67, 0x69, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x2e, 0x73, 0x72, 0x63, 0x2e, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2f, 0x7e, 0x6c, 0x69, 0x6c, 0x6a, 0x61, 0x6d, 0x6f, 0x2f, 0x65, 0x6d, 0x65, 0x72, 0x77, 0x65, 0x6e, 0x2d, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -106,7 +107,7 @@ func file_webtomaster_proto_rawDescGZIP() []byte { var file_webtomaster_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_webtomaster_proto_goTypes = []any{ (*WorkersResponse)(nil), // 0: emerwen.webtomaster.WorkersResponse - (*worker.Worker)(nil), // 1: emerwen.shared.Worker + (*shared.Worker)(nil), // 1: emerwen.shared.Worker (*emptypb.Empty)(nil), // 2: google.protobuf.Empty } var file_webtomaster_proto_depIdxs = []int32{ diff --git a/go/webtomaster_grpc.pb.go b/go/proto/webtomaster_grpc.pb.go similarity index 99% rename from go/webtomaster_grpc.pb.go rename to go/proto/webtomaster_grpc.pb.go index 42dcd35..917fd39 100644 --- a/go/webtomaster_grpc.pb.go +++ b/go/proto/webtomaster_grpc.pb.go @@ -4,7 +4,7 @@ // - protoc v5.28.3 // source: webtomaster.proto -package _go +package proto import ( context "context" diff --git a/justfile b/justfile index 7844973..1efe93c 100644 --- a/justfile +++ b/justfile @@ -2,7 +2,7 @@ _default: just --list compile-protos-go: - protoc --go_out=go --go_opt=paths=source_relative \ - --go-grpc_out=go --go-grpc_opt=paths=source_relative \ + 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 diff --git a/proto/shared/target.proto b/proto/shared/target.proto index 5d85e6e..cc79aa1 100644 --- a/proto/shared/target.proto +++ b/proto/shared/target.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package emerwen.shared; -option go_package = "git.src.quest/~liljamo/emerwen-proto/go/target"; +option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto/shared"; message Target { uint32 id = 1; diff --git a/proto/shared/worker.proto b/proto/shared/worker.proto index 7ff0993..5ec7975 100644 --- a/proto/shared/worker.proto +++ b/proto/shared/worker.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package emerwen.shared; -option go_package = "git.src.quest/~liljamo/emerwen-proto/go/worker"; +option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto/shared"; import "shared/target.proto"; diff --git a/proto/webtomaster.proto b/proto/webtomaster.proto index 801191b..14dbafc 100644 --- a/proto/webtomaster.proto +++ b/proto/webtomaster.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package emerwen.webtomaster; -option go_package = "git.src.quest/~liljamo/emerwen-proto/go"; +option go_package = "git.src.quest/~liljamo/emerwen-proto/go/proto"; import "google/protobuf/empty.proto"; import "shared/worker.proto"; -- 2.44.1