This project is a Go template demonstrating reusable packages and runnable example services.
├── cmd/ # Runnable applications / entrypoints
│ ├── oauth2/ # Example OAuth2 service
│ │ └── main.go
│ ├── otel/ # OpenTelemetry demo service
│ │ └── main.go
│ ├── redis/ # Redis caching example
│ │ └── main.go
│ ├── cache/ # Cache service example
│ │ └── main.go
│ ├── db/ # Database service example
│ │ └── main.go
│ ├── logger/ # Logger example service
│ │ └── main.go
│ ├── openapi/ # OpenAPI server demo
│ │ └── main.go
│ ├── myapp/ # Complete application using all packages
│ │ └── main.go
│ ├── passkey/ # Passkey webauthn examples
│ │ └── main.go
│ └── proto/ # gRPC server/client examples
│ └── main.go
├── pkg/ # Reusable library packages
│ ├── cache/ # Cache interfaces, Redis helpers, wrappers
│ ├── db/ # Database connectors, migrations, helpers
│ ├── logger/ # Zerolog wrapper & helpers
│ ├── oauth2/ # OAuth2 manager & token helpers
│ └── otel/ # OpenTelemetry setup utilities
├── api/
│ └── proto/
│ ├── user/ # Proto definitions
│ │ └── user.proto
│ └── gen/ # Generated .pb.go & _grpc.pb.go (ignored by Git)
├── cfg/ # Centralized config files (YAML, JSON, HCL)
│ ├── app.yaml
│ ├── db.yaml
│ └── redis.yaml
├── k8s/ # Kubernetes manifests (Deployment, Service, ConfigMap)
│ ├── deployment.yaml
│ ├── service.yaml
│ └── configmap.yaml
-
cmd/folder- Each subdirectory represents a separate runnable service or example.
- Demonstrates service configuration and execution.
-
pkg/folder- Contains reusable packages for core functionality.
- Standard Go convention for libraries.
-
Usage Examples
- Run the OAuth2 service:
go run ./cmd/oauth2
- Run the OTEL service:
go run ./cmd/otel
- Each service uses reusable logic from
pkg/.
- Run the OAuth2 service:
Before generating .proto files, install protoc and the required Go plugins. see api/proto/Makefile for the installation