Skip to content

Gas

A modular Go framework for building micro-SaaS applications. Dependency injection, routing, middleware, events, migrations, and service lifecycle, so you write business logic instead of wiring.
main.go
import (
"log"
"net/http"
"github.com/gasmod/gas"
)
func main() {
app := gas.NewApp()
app.Router().Handle("", http.MethodGet, "/", func(ctx gas.Context) error {
return ctx.Text(http.StatusOK, "Hello, World!")
})
if err := app.Run(); err != nil {
log.Fatal(err)
}
}

That is a complete Gas app. Everything else is additive: register modules the same way and let the DI container wire them together.

Take only what you need

Each module is its own Go module, so go get pulls in only what you use. An app that just serves HTTP depends on the core package alone.

Services, not frameworks-in-frameworks

A service is three methods: Name, Init, Close. The container resolves constructors, sorts dependencies, and manages the lifecycle.

Wired by interface

Modules meet through provider interfaces declared in core, so any of them swaps for your own implementation or a test mock.

Fails at startup, not in production

Unresolved dependencies, malformed services, and handler signature mismatches are all rejected before the server accepts traffic.