Skip to content

Commit

Permalink
Move pb package to internal/messaging/pb
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroara committed Jul 25, 2023
1 parent e9c15b0 commit 4f04f0a
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 17 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.PHONY: compile
compile: pb
compile: internal/messaging/pb

.PHONY: clean
clean: clean-pb

.PHONY: recompile
recompile: clean compile

pb:
@mkdir -p pb && docker compose run --rm protoc
internal/messaging/pb:
@mkdir -p internal/messaging/pb && docker compose run --rm protoc

.PHONY: clean-pb
clean-pb:
@rm -rf pb
@rm -rf internal/messaging/pb
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ services:
target: /work
command:
- protoc
- --go_out=pb
- --go_out=internal/messaging/pb
- --go_opt=paths=source_relative
- --go-grpc_out=pb
- --go-grpc_out=internal/messaging/pb
- --go-grpc_opt=paths=source_relative
- --proto_path=./proto
- communicator.proto
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
7 changes: 4 additions & 3 deletions pb/message.pb.go → internal/messaging/pb/message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/messaging/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/hiroara/carbo/pb"
"github.com/hiroara/carbo/internal/messaging/pb"
)

type Server struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/messaging/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"path/filepath"
"testing"

"github.com/hiroara/carbo/internal/messaging/pb"
"github.com/hiroara/carbo/internal/messaging/server"
"github.com/hiroara/carbo/marshal"
"github.com/hiroara/carbo/pb"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/sync/errgroup"
Expand Down
2 changes: 1 addition & 1 deletion proto/communicator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

import "message.proto";

option go_package = "github.com/hiroara/carbo/pb";
option go_package = "github.com/hiroara/carbo/internal/messaging/pb";

service Communicator {
rpc FillBatch(FillBatchRequest) returns (FillBatchResponse) {}
Expand Down
2 changes: 1 addition & 1 deletion proto/message.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
syntax = "proto3";

option go_package = "github.com/hiroara/carbo/pb";
option go_package = "github.com/hiroara/carbo/internal/messaging/pb";

message Message {
bytes value = 1;
Expand Down
2 changes: 1 addition & 1 deletion sink/expose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"google.golang.org/grpc/credentials/insecure"

"github.com/hiroara/carbo/flow"
"github.com/hiroara/carbo/internal/messaging/pb"
"github.com/hiroara/carbo/marshal"
"github.com/hiroara/carbo/pb"
"github.com/hiroara/carbo/sink"
"github.com/hiroara/carbo/source"
"github.com/hiroara/carbo/task"
Expand Down
2 changes: 1 addition & 1 deletion source/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"google.golang.org/grpc"

"github.com/hiroara/carbo/internal/messaging/pb"
"github.com/hiroara/carbo/marshal"
"github.com/hiroara/carbo/pb"
"github.com/hiroara/carbo/task"
)

Expand Down

0 comments on commit 4f04f0a

Please sign in to comment.