Batteries included for Go, one module at a time.
Early alpha: ubgo is still being built and is not fully production-ready yet, so libraries and APIs may change.
Open-source Go libraries, plus a few TypeScript ones, for errors, logging, caching, config, SQL, GraphQL, HTTP services, crypto and tooling.
ubgo is an ecosystem for building Go apps, in the spirit of the components Laravel ships for caching, logging and configuration. Every piece is its own Go module, so a service imports only what it uses: structured errors and logging, caching with Redis, Postgres, Memcached and in-memory backends, typed configuration and .env files, SQL building, GraphQL and ent helpers, health checks, graceful shutdown and crypto. The main libraries share one shape, a small core with adapters outside it and a shared test suite, so learning one teaches you the next.
- errx: One structured error type with stable identity, class, redactable fields, return traces and a wire codec.
- goerr: Error type with separate operator and user messages, error codes, key/value data and trace IDs.
- logger: Adapter-based, slog-native structured logging with sampling, redaction, OpenTelemetry and rotation.
- otelkit: One constructor that sets up OpenTelemetry traces, metrics and logs, with presets for common backends.
- cache: The core cache interface with generics, single-flight Remember, a distributed locker and a shared conformance suite.
- cache-cli: Command-line cache inspector (get, set, del, stats, keys) with JSON output, built on cache. (CLI)
- cache-cluster: Peer-aware distributed cache with a consistent-hash ring and HTTP peer fill, on any cache backend.
- cache-examples: Runnable examples for the cache family, one self-contained program per feature. (examples)
- cache-mem: Sharded in-memory backend for cache with W-TinyLFU or LRU eviction and optional snapshots.
- cache-memcached: Memcached backend for cache, covering the parts of the interface Memcached supports.
- cache-obj: In-process cache that holds live Go objects by reference, with TTL and LRU and no serialization.
- cache-pg: Postgres and SQLite backend for cache over database/sql, with Migrate and Vacuum.
- cache-redis: Redis 6+ backend for cache with prefix isolation and Pub/Sub invalidation across processes.
- cache-tiered: Stacks cache backends into L1/L2/L3 tiers with read promotion and per-tier TTL.
- threadsafecache: Generic thread-safe LRU and TTL cache. Deprecated; use cache-obj instead.
- cfgkit: Typed config from env, .env, JSON, YAML, TOML, flags and secret stores into one validated struct.
- dotenv: .env parser and editor that keeps comments, order and quoting, plus the dotenvctl CLI.
- gormuuid: Postgres uuid[] field type for GORM.
- gouuid: Small helpers around google/uuid.
- jsonslice: A JSON-backed slice that round-trips through SQL columns and gqlgen scalars.
- jsontype: A JSON type that round-trips between Go, JSON and SQL drivers (Postgres jsonb, MySQL json, SQLite).
- lock: One lock interface with five backends (filelock, flock, Redis, Postgres, etcd) and fencing tokens.
- publicid: URL-safe, non-sequential public IDs from a fixed lowercase nanoid alphabet.
- sqlb: Typed SQL builder with compile-checked columns and joins, Postgres and ClickHouse packages and a driver conformance suite.
- entkit: Column types and field helpers for ent and gqlgen, as small independent modules.
- entx: Extensions for ent such as polymorphic relations, cascade delete and per-API GraphQL schemas.
- gqlgenfn: Helper functions for using gqlgen with Gin.
- gqlkit: Generates typed GraphQL client SDKs for Go and TypeScript with compile-checked field selection.
- gqlmodel: Custom scalar field types for gqlgen.
- gqlutil: Small helper functions for gqlgen.
- buildinfo: Version, commit, build time and module info for Go binaries, from runtime/debug with -ldflags overrides.
- buildinfo-examples: Runnable example apps for buildinfo, from ldflags stamping to HTTP, OpenTelemetry, Zap and slog. (examples)
- gofm: An early framework for building Go microservices.
- health: Thread-safe health and readiness registry with k8s-style probes, framework adapters and ready-made checkers.
- health-examples: Runnable example apps for health, covering every HTTP framework adapter and observability. (examples)
- httpreq: JSON-over-HTTP calls on top of net/http with one function, options and typed errors.
- shutdown: Phased graceful shutdown for services, parallel within a phase, with a watchdog and telemetry hooks.
- shutdown-examples: Runnable examples for shutdown. (examples)
- crypt: Go crypto with safe defaults (AES-GCM, ChaCha20-Poly1305, argon2id, HMAC, Ed25519, key rotation), byte-compatible with crypt-ts.
- crypt-ts: TypeScript and Node.js crypto with safe defaults over node:crypto, byte-compatible with the Go crypt.
- docsync: Finds the sentences in your docs that stopped being true when the code they describe changed.
- gots: Generates TypeScript types, enums, constants and interfaces from Go source. (CLI)
- goutil: A small set of everyday Go helper functions.
- lath: A task runner where tasks are typed Go functions and a deploy runs the same on a laptop, over ssh and in CI. (CLI)
- ubgo-skills: Reusable skill files that capture Go and frontend coding conventions.
More libraries are on the way.
Volt is the layer on top of ubgo to build, release and ship Go CLIs and libraries: the volt tool (scaffold, CI gate, coverage, cross-platform builds, verified releases) plus importable kit modules for building the CLIs themselves.
brew install khanakia/tap/volt- voltkit: The Volt tool to scaffold, check, build, release and ship Go CLIs and libraries in any repo layout, plus importable kit modules for building the CLIs themselves.
- volt-cli: Templates for volt new cli, a stdlib-only minimal CLI and a cobra variant, fetched at a pinned tag.
- volt-action: GitHub Action that installs the released Volt binary, checksum-verified, and runs one command such as volt ci or volt release.
- volt-demo-cli: Demo of a single-CLI repo released with Volt, with install scripts, workflows and a skills command generated by volt gen.
- volt-demo-clis: Demo of a monorepo with two CLIs, nested libraries and an internal module, each released on its own tag stream.
- volt-demo-lib: Demo of a single-library repo, released with notes and a verified module proxy entry instead of binaries.
App starters are coming.
These hold for the libraries named under each point, as their own READMEs state. They are not a promise for every repo.
- Small cores. The core module has no third-party dependencies, so importing it adds nothing to your go.sum. For example: 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. For example: 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. For example: cache, cache-obj, sqlb.
Most libraries install with:
go get github.com/ubgo/<name>Some are split into sub-modules or ship a CLI to go install. Each repo's README, and its page on ubgo.github.io, gives the exact line.
Do I need to install everything? No. Every library is its own Go module (and some split further into sub-modules), so you add only the ones you use.
Where are the docs? Each repository's README, plus its page on pkg.go.dev (or npm for the TypeScript ones). The library index links to both.
What license are they under? Every library is open source under Apache-2.0. The LICENSE file in each repository is the source of truth.
Where do I report a bug? Open an issue in that library's repository.