A powerful and flexible template for building Go HTTP + GRPC servers with full OpenTelemetry (OTEL) support.
Bootstrapped with the go-app framework to provide all the bells and whistles right out of the box.
Ideal for rapidly creating production-ready microservices.
π Proto Compilation β Seamlessly compile .proto files with make proto.
π Project Renaming β Easily rename your project using make rename NAME=your.gitremote.com/pathto/repo.
π¦ Helm Chart β Deploy your application with Kubernetes using the provided Helm chart.
π€ Gitea CI Integration β Out-of-the-box Gitea CI pipeline configuration with .gitea/workflows/ci.yaml.
βοΈ Expandable Configuration β Extend your app-specific configuration with go-app's built-in logging, HTTP, and GRPC config support.
π Getting Started
Install tools:
Install make, protoc, and go using brew, apt, etc..
Install protoc plugins (provided in go.mod tool()):
go get -v tool && go install -v tool
Rename your package:
make rename NAME=my.gitremote.com/pathto/repo
Review the config struct:
Update and customize your app-specific configuration. This merges with go-app's configuration, providing logging, HTTP, and GRPC config for free.
Generate a new JSON schema:
make schema
Ensure your structs have yaml and json tags.
With the yaml-language-server LSP plugin, the schema will be auto-detected in your config.yaml.
Compile proto files:
make proto
Add paths under proto/ as necessary.
Implement your application logic.
Update Gitea CI configuration:
Modify parameters in .gitea/workflows/ci.yaml as needed.
Tag your release: git tag v0.1.0 and push git push --tags
π Project Structure
proto/ - Protobuf definitions and generated files.
api/ - Auto-generated code for proto, grpc-gateway, and OpenAPI2 spec
pkg/config/ - Custom config, merged with go-app configuration
pkg/demo(http|grpc)/ - HTTP and GRPC server implementations
helm/ - Helm chart for deploying your application to Kubernetes.
.gitea/workflows/ - CI pipelines for automated builds and tests.
π₯ Ready to build something awesome? Let's go! π
This template contains a simple
app with OTEL bootstrap that will create an
HTTP server configured by environment that exports
spans and metrics to an OTEL collector if configured
to do so. Will also stand up a prometheus metrics
endpoint.
Configuration and logger stored in context
Reference implementation of the provided packages