QuicksGo is a modular framework for bootstrapping Go services with a shared approach to configuration, transport, observability, and security.
It helps you assemble applications faster with:
- Gin HTTP servers
- gRPC servers
- HTTP and gRPC clients
- structured logging
- OpenTelemetry tracing
- JWT and security middleware
viper-based configuration loading- simple in-process background jobs
- config: server and client bootstrap, configuration loading, tracing, and jobs
- logger: structured logging plus HTTP and gRPC middleware
- security: JWT, security middleware, and cryptographic helpers
- cmd/qgo: CLI for scaffolding new Gin and gRPC services
A typical QuicksGo application flow looks like this:
config/utilities.LoadEnvloadsapplication.ymlorapplication.jsonintoviperconfiginitializesloggerconfiginitializes OpenTelemetry tracingconfig/server/ginorconfig/server/grpcstarts the serversecurityconsumes the same sharedviperconfigurationconfig/client/httpandconfig/client/grpcreuse tracing and logging for outbound calls
Install the root module:
go get github.com/PointerByte/QuicksGoOr install only the module you need:
go get github.com/PointerByte/QuicksGo/config
go get github.com/PointerByte/QuicksGo/logger
go get github.com/PointerByte/QuicksGo/securityThe complete framework templates are available at:
Supported load priority:
application.ymlapplication.json.env.env.local- environment variables
YAML is the recommended format for new applications.
app:
name: quicksgo-server
version: 0.0.1
server:
groups:
- /api/v1
gin:
port: ":8080"
mode: release
UseH2C: true
rate:
limit: 1000
burst: 2000
grpc:
port: ":50051"
logger:
dir: logs
level: info
jwt:
enable: true
transport: cookie
cookie:
name: session_token
algorithm: HS256
hmac:
secret: change-meOverrides are generated from the key path. Examples:
app.name->APP_NAMEserver.port->SERVER_PORTserver.gin.port->SERVER_GIN_PORTserver.grpc.port->SERVER_GRPC_PORTclient.grpc.tls.serverName->CLIENT_GRPC_TLS_SERVERNAMEjwt.hmac.secret->JWT_HMAC_SECRET
The example templates include the keys most commonly used across config, logger, and security.
app.name: service name used by health endpoints, logger metadata, and OTEL resource namingapp.version: service version reported by health endpoints and OTEL metadata
server.groups: Gin route groups created automatically byconfig/server/ginserver.modeTest: helper flag used in tests to simplify runtime behavior
server.gin.port: HTTP listen addressserver.gin.mode: Gin mode such asdebug,release, ortestserver.gin.UseH2C: enables HTTP/2 cleartext supportserver.gin.rate.limit: built-in rate limiter request rateserver.gin.rate.burst: burst size for the limiter
server.gin.LoggerWithConfig.enabled: enables the structured HTTP request loggerserver.gin.LoggerWithConfig.SkipPaths: routes skipped by the logger middlewareserver.gin.LoggerWithConfig.SkipQueryString: hides the query string from the logged path
server.grpc.port: gRPC listen address
server.grpc.tls.enable: enables TLS on the gRPC serverserver.grpc.tls.certFile: server certificate pathserver.grpc.tls.keyFile: server private key pathserver.grpc.tls.version: minimum TLS version such astlsv12ortlsv13
server.grpc.mtls.enable: enables mTLS validation on the gRPC serverserver.grpc.mtls.clientCAFile: CA file used to validate client certificatesserver.grpc.mtls.clientAuth: client certificate policy
Supported server.grpc.mtls.clientAuth values:
request_client_certrequire_any_client_certverify_client_cert_if_givenrequire_and_verify_client_cert
gin.autotls.enable: enables automatic certificate management throughautocertgin.autotls.domain: allowed domain for managed certificatesgin.autotls.dirCache: local cache directory forautocertgin.autotls.version: minimum TLS version for auto TLS
client.grpc.tls.enable: enables TLS on the outbound gRPC clientclient.grpc.tls.caFile: CA bundle used to validate the remote server certificateclient.grpc.tls.serverName: expected server name during certificate validationclient.grpc.tls.version: minimum TLS version for the client transportclient.grpc.tls.insecureSkipVerify: disables certificate validation and should be used only in controlled development scenarios
client.grpc.mtls.enable: enables mTLS on the outbound gRPC clientclient.grpc.mtls.certFile: client certificate pathclient.grpc.mtls.keyFile: client private key path
logger.dir: directory used to create the log filelogger.modeTest: disables logger output during testslogger.level: minimum log level such asdebug,info,warn, orerrorlogger.ignoredHeaders: headers that must not appear in structured logslogger.formatter: output format such asjsonortextlogger.formatDate: timestamp format used by the formatter
logger.rotate.enable: enables file rotation throughlumberjacklogger.rotate.maxSize: maximum log file size in MB before rotationlogger.rotate.maxBackups: maximum number of rotated files to keeplogger.rotate.maxAge: maximum age in days for rotated fileslogger.rotate.compress: compresses rotated files when enabled
traces.SkipPaths: HTTP paths excluded from Gin OpenTelemetry middleware
jwt.enable: enables or disables JWT middleware enforcementjwt.transport: JWT source used by Gin middleware. Supported values:headerandcookiejwt.algorithm: signing algorithm such asHS256,RS256,PS256, orEdDSA
jwt.cookie.name: cookie name used whenjwt.transportiscookie
jwt.hmac.secret: shared secret used by HMAC-based JWT algorithms
jwt.rsa.private_key: RSA private key in string form for signingjwt.rsa.public_key: RSA public key in string form for verification
jwt.eddsa.private_key: Ed25519 private key in string form for signingjwt.eddsa.public_key: Ed25519 public key in string form for verification
Services bootstrapped with QuicksGo are already prepared for OpenTelemetry-based observability.
That includes:
- traces
- logs
- metrics
QuicksGo is also compatible with the OpenTelemetry Go Auto Instrumentation SDK when your deployment strategy needs automatic instrumentation on top of the framework setup.
config/server/gin.CreateApp():
- loads configuration
- initializes logger
- initializes OpenTelemetry
- creates the
gin.Engine - registers shared middleware
- applies JWT middleware when configured
- creates groups from
server.groups - registers
/healthand/refreshfor each group
Basic usage:
package main
import (
"log"
"github.com/gin-gonic/gin"
serverGin "github.com/PointerByte/QuicksGo/config/server/gin"
)
func main() {
srv, err := serverGin.CreateApp()
if err != nil {
log.Fatal(err)
}
api := serverGin.GetRoute("/api/v1")
api.GET("/hello", func(c *gin.Context) {
c.JSON(200, gin.H{"message": "ok"})
})
serverGin.Start(srv)
}Each route group created from server.groups also gets a GET /refresh endpoint.
It is intended for:
- reloading cache or in-memory state
- restarting background jobs across instances
- propagating refresh events to peers registered with
SetHostsRefresh(...)
If you need local refresh logic before fan-out, register callbacks with SetFunctionsRefresh(...).
config/server/grpc:
- loads configuration when
Serve()runs - resolves
server.grpc.portfromviper - integrates logger and trace interceptors
- supports TLS and mTLS
- listens to shutdown signals and performs
GracefulStop()
Basic usage:
package main
import (
"context"
"log"
pb "github.com/PointerByte/QuicksGo/config/proto"
serverGRPC "github.com/PointerByte/QuicksGo/config/server/grpc"
"google.golang.org/grpc"
)
type greeterServer struct {
pb.UnimplementedGreeterServer
}
func (s greeterServer) SayHello(_ context.Context, req *pb.HelloRequest) (*pb.HelloReply, error) {
return &pb.HelloReply{Message: "hello " + req.GetName()}, nil
}
func (s greeterServer) CreateChat(stream grpc.ClientStreamingServer[pb.ChatMessage, pb.ChatSummary]) error {
return nil
}
func (s greeterServer) StreamAlerts(stream grpc.BidiStreamingServer[pb.AlertMessage, pb.AlertMessage]) error {
return nil
}
func main() {
srv := serverGRPC.NewIConfig(nil, nil)
if err := srv.Register(func(r grpc.ServiceRegistrar) {
pb.RegisterGreeterServer(r, greeterServer{})
}); err != nil {
log.Fatal(err)
}
log.Fatal(srv.Serve())
}config/server/grpc exposes an internal administrative refresh RPC through "/quicksgo.admin/Refresh".
It is intended for:
- refreshing process-local state on all nodes
- restarting package-level scheduled jobs in a coordinated way
- propagating internal reload events across gRPC instances
config/client/http exposes a generic REST client with request and response tracing.
client := clientHttp.NewGenericRest(10*time.Second, nil)
err := client.GetGeneric(ctx, clientHttp.RequestGeneric{
System: "users-service",
Process: "list-users",
Host: "https://api.example.com",
Path: "users",
Response: &usersResponse,
})config/client/grpc wraps grpc.ClientConn and can:
- build protobuf clients through
BuildClient - resolve TLS and mTLS from
viper - trace metadata, request, and response through
logger
cli := clientGRPC.NewIClient(nil)
greeter, err := clientGRPC.BuildClient(cli, pb.NewGreeterClient)
if err != nil {
panic(err)
}config/utilities/jobs provides simple in-process recurring tasks.
Common entry points:
jobs.Job(...)jobs.CronJob(...)jobs.StartJobs()jobs.RestartJobs()jobs.StopAllJobs(...)jobs.CheckStatusJobs()
Important behavior:
- jobs start only after
StartJobs()runs config/server/gin.Start(...)already callsjobs.StartJobs()- jobs registered after
StartJobs()starts are launched immediately - when
server.modeTest=true, jobs do not run
Example:
func registerJobs() {
timeout := 30 * time.Minute
jobs.Job(func() {
refreshCache()
}, time.Minute, &timeout)
jobs.CronJob(func() {
buildDailyReport()
}, jobs.CronTrigger{
Hour: 2,
Minute: 0,
Second: 0,
}, 0)
}
func main() {
registerJobs()
srv, err := serverGin.CreateApp()
if err != nil {
log.Fatal(err)
}
serverGin.Start(srv)
}The config module includes a runnable example in config/main.go.
Run the Gin example:
$env:QUICKSGO_EXAMPLE_SERVER="gin"
go run ./configRun the gRPC example:
$env:QUICKSGO_EXAMPLE_SERVER="grpc"
go run ./configIf you are starting a new application with QuicksGo:
- start from config/application.yml
- load configuration with
config/utilities.LoadEnv - use
config/server/ginorconfig/server/grpcas your bootstrap layer - define your routes or protobuf services
- use
securityfor JWT and endpoint protection - use
config/client/httporconfig/client/grpcfor traced outbound calls - use
config/utilities/jobswhen you need lightweight recurring background work
You can also scaffold a new service with qgo:
go install github.com/PointerByte/QuicksGo/cmd/qgo@latest
qgo new gin
qgo new grpcRequired commands:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
protoc --go_out=. --go-grpc_out=. config/proto/methods.protogo test ./...go get -u ./...go clean -cache -testcache -modcachego test -cover -covermode=atomic -coverprofile="coverage.out" ./...go tool cover -html="coverage.out" -o "coverage.html"go tool cover -func="coverage.out"