-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change package structure * Add tests for config provider * Update copyrights * Correct struct name. Remove redundand code * Correct makefile * Add tests for routers * Correct link to license in copyright * Review correction. Make connection manager internal * Correct prometheus module registration * Add raw listener subscription * Refactor subscribing for messages * Extract common part for subscription handling * Extract start and subscribe methods * Migrate event router to common subscriber implementation * Added trace level for logging (#12) * Cleanup subscribers code * Store generate protobuf structs in repository * Update testcontainers dep * Execute go mod tidy --------- Co-authored-by: Nikita Smirnov <[email protected]>
- Loading branch information
1 parent
7b272c7
commit 6b5f3cb
Showing
93 changed files
with
8,327 additions
and
2,346 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,54 +2,43 @@ SRC_MAIN_PROTO_DIR=src/main/proto | |
GITHUB_TH2=github.com/th2-net | ||
|
||
TH2_GRPC_COMMON=th2-grpc-common | ||
TH2_GRPC_COMMON_URL=$(GITHUB_TH2)/$(TH2_GRPC_COMMON)@makefile | ||
TH2_GRPC_COMMON_URL=$(GITHUB_TH2)/$(TH2_GRPC_COMMON)@4.3.0-dev | ||
|
||
MODULE_NAME=th2-grpc | ||
MODULE_DIR=$(MODULE_NAME) | ||
|
||
PROTOBUF_VERSION=v1.5.2 | ||
MODULE_DIR=pkg/common/grpc | ||
|
||
PROTOC_VERSION=21.12 | ||
|
||
default: prepare-main-module build | ||
init-work-space: clean-grpc-module prepare-grpc-module configure-grpc-generator generate-grpc-files tidy | ||
|
||
configure-go: | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
configure-grpc-generator: | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
|
||
clean-grpc-module: | ||
-rm -rf $(MODULE_DIR) | ||
|
||
prepare-grpc-module: clean-grpc-module | ||
mkdir $(MODULE_DIR) | ||
cd $(MODULE_DIR) && go mod init $(MODULE_NAME) | ||
prepare-grpc-module: | ||
- mkdir $(MODULE_DIR) | ||
cd $(MODULE_DIR) | ||
|
||
cd $(MODULE_DIR) \ | ||
&& go get -u -t $(TH2_GRPC_COMMON_URL) \ | ||
&& go get -u -t github.com/golang/protobuf@$(PROTOBUF_VERSION) \ | ||
&& go get -u -t google.golang.org/[email protected] \ | ||
&& go get -u -t github.com/google/[email protected] | ||
|
||
- go work init | ||
go work use ./$(MODULE_DIR) | ||
&& go get $(TH2_GRPC_COMMON_URL) \ | ||
&& go get google.golang.org/[email protected] \ | ||
&& go get github.com/google/[email protected] | ||
|
||
genrate-grpc-files: prepare-grpc-module configure-go | ||
generate-grpc-files: | ||
$(eval $@_PROTO_DIR := $(shell go list -m -f '{{.Dir}}' $(TH2_GRPC_COMMON_URL))/$(SRC_MAIN_PROTO_DIR)) | ||
protoc \ | ||
--go_out=$(MODULE_DIR) \ | ||
--go_opt=paths=source_relative \ | ||
--go-grpc_out=$(MODULE_DIR) \ | ||
--go-grpc_opt=paths=source_relative \ | ||
--proto_path=$($@_PROTO_DIR) \ | ||
$(shell find $($@_PROTO_DIR) -name '*.proto' ) | ||
|
||
prepare-main-module: genrate-grpc-files | ||
- go work init | ||
go work use . | ||
tidy: | ||
go mod tidy -v | ||
|
||
build: | ||
go vet ./... | ||
go build -v -race ./... | ||
go build -v ./... | ||
|
||
test: | ||
go test -v ./... | ||
run-test: | ||
go test -v -race ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.