Generate gRPC and Go service code
proto-generator.skillskillsetup L2★15
ikaiguang/go-srv-kit ↗What it does
Generate Go code from Proto definitions
Best for
Generating gRPC and HTTP stubs with validation and Swagger docs in one command—avoids manual interface coding.
Inputs
- · Service name (e.g., ping-service)
- · Version (e.g., v1)
- · Proto file path
Outputs
- · *.pb.go (messages)
- · *.grpc.pb.go (gRPC)
- · *.http.pb.go (HTTP)
- · *.validate.go (validation)
- · *.swagger.json (API docs)
Requires
- · protoc compiler
- · Go plugins (protoc-gen-go, protoc-gen-go-grpc, protoc-gen-go-http, protoc-gen-validate, protoc-gen-openapiv2)
Preconditions
- · Proto files written
- · protoc installed
- · Go 1.18+
- · Make targets defined
Failure modes
- · Protoc plugin missing
- · Proto syntax error
- · Import path incorrect
- · Swagger generation fails
Trust signals
- · HTTP and gRPC dual codegen
- · Built-in validation code
- · Swagger auto-generation
- · Make target encapsulation