[Go Generated] (https://protobuf.dev/reference/go/go-generated/)
# add schema version
sh schema.sh $msg
# CDI wire generation
sh wire-build.sh
# start demo server A
export GRPC_SERVER_PORT=50051
sh start-server.sh
# start demo server B
export GRPC_SERVER_PORT=50052
sh start-server.sh
# start client call
sh start-client.sh
- gRPC
- Go
- Gorm
- Zerolog
- Wire
- Viper
- Yaml
- PostgreSQL
Feature | Remark | Status |
---|---|---|
Authentication | JWT OAuth2 | OK |
Configuration | Yaml, Viper | OK |
Gorm | PostgreSQL | OK |
Interceptor | Unray | OK |
Metrics | OTEL | OK |
Tracing | OTEL | OK |
Validation | protovalidate-go | OK |
Error Handling | Errno naming, Translation | OK |
Error Model | Google Richer Error model | OK |
Load balancing | client side | - |
Health check | client & server side import health check package | OK |
Retry | client side | - |
Wait-for-Ready | client side | - |
Deadline | timeout, client side, context.WithTimeout | - |
Service Config | client side | - |
Profiling | channelz | - |
Logging | zerolog | OK |
Streaming | - | - |
Cache | - | - |
Messaging | - | - |
Distributed | - | - |
Testing | testify | OK |
Flow Control | Rate Limit, SHOULD be handled by Gateway | - |
API Versioning | via versioning on proto files | - |
DB Migration | go-migrate on schema | OK |
Repository | as design with entity | OK |
CDI | wire | OK |
AuthZ | casbin | - |
API Specification | grpc-gateway, openapiv2 | OK |
Rules are here. https://buf.build/bufbuild/protovalidate/docs/main:buf.validate
health/v1
GRPC_GO_LOG_VERBOSITY_LEVEL=99 GRPC_GO_LOG_SEVERITY_LEVEL=info
Golangci-lint aggregates dozens of tools with hundreds of checks. Revive is one of such tools
git config core.hooksPath .git-hooks
go mod tidy
go install \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc
Buf CLI is a great drop-in replacement for protoc
# install CLI
brew install bufbuild/buf/buf
# update dependencies
buf dep update
# lint on proto files
buf lint
# generate code
buf generate