ubgo is in early alpha: libraries and APIs may still change.

Skip to content
ubgo Alpha

About

Why ubgo exists

Building an app means solving the same problems again and again: errors, logs, caching, configuration, locks, health checks, shutting down cleanly. Laravel answers that for PHP with components for caching, logging, configuration and more that come with the framework. ubgo is that kind of ecosystem for Go, batteries included to build apps.

The difference is how it is packaged. Every piece is its own open-source Go module, so a service imports only what it uses. The main libraries share the same conventions, a small core, adapters outside it and a shared test suite, so learning one teaches you the next.

How ubgo compares

ubgo is not one framework you adopt whole. It is a set of Go modules that follow the same rules. Every point below is checked against the repos.

ubgo is

  • Separate Go modules. 209 go.mod files across the 45 public libraries. You add the ones you use. See the map
  • Small cores, adapters outside them. 76 adapter modules live in contrib/ folders, so an integration's dependencies stay out of your build until you import it. For example errx, logger and health.
  • Backends you can swap, checked by one suite. cache (cachetest), cache-obj (objtest), cfgkit (cfgkittest), sqlb (sqlbtest): a backend counts only when its tests run the suite.
  • Fits the HTTP stack you already use. health, shutdown and buildinfo ship adapters for net/http, Gin, Chi, Echo and Fiber.

ubgo is not

  • A web framework. There is no ubgo router or request lifecycle. You keep your own, and the libraries plug into it.
  • An ORM. sqlb builds typed SQL; entkit and entx extend the ent ORM instead of replacing it.
  • All or nothing. A library needs another one only when its go.mod says so, and the map draws every one of those links.

Volt, the layer on top

ubgo libraries are the parts your code runs on. Volt is the tooling that turns your code into a released, installable program.

3 · Your app

A CLI, a library or a service

mytool (volt new cli)your libraryyour service app starters are coming

2 · Volt tooling

voltkit →

The Volt tool

volt newvolt statusvolt civolt covervolt buildvolt releasevolt gen

Kit modules you import

appdiroutputskillcmdversioncmd

Real link: voltkit's versioncmd module requires ubgo/buildinfo in its go.mod.

More libraries are on the way.

ubgo is in early alpha: it is still being built and is not fully production-ready yet, so libraries and APIs may change.

ubgo is maintained by Aman Bansal. There are 45 public libraries across 8 areas, plus the Volt repos. Issues and pull requests go to each repository.

Principles

These are true of the libraries named under each one, as stated in their own READMEs. They are not promised for every library.

Small cores

The core module has no third-party dependencies, so importing it adds nothing to your go.sum. Examples: errx, logger, health, shutdown, buildinfo, sqlb, lock, httpreq.

Adapters live outside the core

Integrations (frameworks, OpenTelemetry, drivers, secret stores) ship as separate modules, so you only download what you import. Examples: errx, logger, health, shutdown, buildinfo, cfgkit, sqlb, otelkit, lock.

Shared conformance suites

A family's contract is a test suite that every backend runs, so backends behave the same. Examples: cache, cache-obj, sqlb.

Licenses

Every library is open source under Apache-2.0. This is read from the LICENSE file in each of the 45 repositories.

Install

Go libraries install with go get github.com/ubgo/<name>. Some are split into sub-modules or ship a CLI to go install; each library page shows the exact line from its README.