Setting up development environment
1. Setting up development environment:
- Export GOPATH to VSCode/IDE on Linux/MacOS
export GOPATH="$HOME/go"
PATH="$GOPATH/bin:$PATH"
- Install development libraries:
make init
or
go install github.com/go-kratos/kratos/cmd/kratos/v2@latest
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go install github.com/go-kratos/kratos/cmd/protoc-gen-go-http/v2@latest
go install github.com/go-kratos/kratos/cmd/protoc-gen-go-errors/v2@latest
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@latest
go install github.com/google/gnostic/cmd/protoc-gen-openapi@latest
go install github.com/google/wire/cmd/wire@latest
go install github.com/envoyproxy/protoc-gen-validate@latest
go install github.com/nicksnyder/go-i18n/v2/goi18n@latest
go install github.com/go-kratos/grpc-gateway/v2@latest
go install github.com/favadi/protoc-go-inject-tag@latest
2. Generate using make
Generate GRPC server
make grpcGenerate HTTP server
make httpGenerate dependencies using Wire
make wireGenerate Validation rules
make validateGenerate Swagger template
make swaggerGenerate configuration Model
make configGeneral external .proto files
make extGeneral all internal rules
make allInstall dependent package
make modShow make help
make help