-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split codes and fix fuzzy show on maps (#159)
- split server to different pkgs - fix fuzzy data show as GeoJSON - update lint
- Loading branch information
1 parent
11556ce
commit 7de975a
Showing
32 changed files
with
1,345 additions
and
689 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 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 |
---|---|---|
@@ -1,37 +1,52 @@ | ||
GOBASEPATH=$(shell go env var GOPATH | xargs) | ||
|
||
help: ## Show this help. | ||
@egrep -h '\s##\s' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
|
||
.PHONY:build | ||
build: | ||
build: ## Build tzf server | ||
go build | ||
|
||
.PHONY:test | ||
test: | ||
test: ## Run test | ||
go test -json -race ./... -v -coverprofile=coverage.txt -covermode=atomic | tparse -all | ||
|
||
.PHONY:bench | ||
bench: | ||
bench: ## Run benchmark | ||
go test -bench=. -benchmem ./... | ||
|
||
.PHONY:cover | ||
cover: | ||
cover: ## Generate coverage report | ||
go tool cover -html=coverage.txt -o=coverage.html | ||
|
||
mock: | ||
mockgen -source=$(GOBASEPATH)/pkg/mod/github.com/tidwall/redcon@v1.6.2/redcon.go -destination="handler/mock_redcon_test.go" -package=handler_test | ||
mock: ## Generate mock | ||
mockgen -source=$(GOBASEPATH)/pkg/mod/github.com/tidwall/redcon@v1.6.2/redcon.go -destination="internal/redisserver/mock_redcon_test.go" -package=redisserver_test | ||
|
||
install: | ||
go install github.com/favadi/protoc-go-inject-tag@latest | ||
install: ## Install tools | ||
go install github.com/mfridman/tparse@latest | ||
go install go.uber.org/mock/mockgen@latest | ||
go install github.com/wolfogre/gtag/cmd/gtag@latest | ||
go install github.com/google/wire/cmd/wire@latest | ||
go install github.com/favadi/protoc-go-inject-tag@latest | ||
go install github.com/ringsaturn/protoc-gen-go-hertz@latest | ||
|
||
.PHONY:pb | ||
pb: | ||
pb: ## Generate protobuf | ||
buf build | ||
buf generate | ||
protoc-go-inject-tag -input="tzf/v1/*.pb.go" -remove_tag_comment | ||
go fmt ./... | ||
|
||
fmt: | ||
fmt: ## Format code | ||
find proto/v1 -iname *.proto | xargs clang-format -i --style=Google | ||
go fmt ./... | ||
go fix ./... | ||
|
||
gtag: ## Generate gtag | ||
cd internal/config;gtag -types Config -tags flag . | ||
|
||
gen: ## Generate code | ||
make pb | ||
make mock | ||
make gtag |
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 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 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.