Spring Boot, for Go.
Controllers, not boilerplate
Register a controller and return typed DTOs. Ginboot wires up binding, error handling, tracing and serialisation — and the same code runs as an HTTP server or a Lambda function.
package main
import (
"log"
"github.com/klass-lk/ginboot"
"github.com/klass-lk/ginboot/example/internal/controller"
)
func main() {
// Loads ginboot.yml / application.yml and .env automatically
server := ginboot.New()
cfg := server.Config()
server.SetBasePath(cfg.Ginboot.Server.BasePath)
server.RegisterController("/posts", controller.NewPostController(svc))
// Runs as HTTP locally, as an API Gateway proxy on AWS Lambda
if err := server.Start(cfg.Ginboot.Server.Port); err != nil {
log.Fatal(err)
}
}package controller
import "github.com/klass-lk/ginboot"
func (c *PostController) Register(group *ginboot.ControllerGroup) {
group.GET("/:id", c.GetPost)
protected := group.Group("")
protected.POST("", c.CreatePost)
}
// Handlers return (DTO, error) — Ginboot handles binding,
// status codes and JSON serialisation for you.
func (c *PostController) GetPost(ctx *ginboot.Context) (model.Post, error) {
return c.postService.GetPostById(ctx.Param("id"))
}
func (c *PostController) CreatePost(ctx *ginboot.Context, req model.Post) (model.Post, error) {
post, err := c.postService.CreatePost(req)
if err != nil {
return model.Post{}, ginboot.NewApiError(400, "invalid post")
}
// Fire-and-forget call to another service, traced end to end
_ = ctx.CallServiceAsync("notification-service", "/notifications/send", post)
return post, nil
}Batteries included
Everything a production Go service needs, wired up and ready — without giving up the Gin APIs you already know.
Database agnostic
Generic repositories for MongoDB, SQL and DynamoDB behind one interface. CRUD and pagination with almost no code.
Serverless ready
Detects AWS Lambda at runtime and proxies API Gateway requests automatically. The same controllers run either way.
Built-in telemetry
An optional OpenTelemetry plugin ships traces, metrics and logs to Grafana or any OTLP backend, with trace-correlated logging.
Declarative config
ginboot.yml plus automatic .env loading and four env-var injection syntaxes. Read it back with a typed server.Config().
Service to service
ctx.CallService resolves targets from config, env or DNS and propagates W3C trace and auth headers for you.
BDD testing
Godog and Cucumber integration with built-in step definitions, so API behaviour is specified in plain Gherkin.
Ship it with Ginboot Cloud
One-click deploys, managed environments, live log streaming and telemetry dashboards — purpose-built for Ginboot services.