Skip to content
@ubgo

Ubgo

Batteries included for Go, one module at a time.

ubgo logo: a bold lowercase u holding one amber block

ubgo

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.

Website: ubgo.github.io 45 public libraries Languages: Go and TypeScript License: Apache-2.0

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.

Libraries by area

Errors and logging

  • 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.

Caching

  • 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.

Config and env

  • 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.

SQL and data

  • 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.

GraphQL and ent

  • 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.

HTTP and services

  • 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)

Crypto

  • 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.

Tooling

  • 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

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.

Principles

These hold for the libraries named under each point, as their own READMEs state. They are not a promise for every repo.

Install

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.

FAQ

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.

Pinned Loading

  1. logger logger Public

    Pluggable, adapter-based, slog-native zero-allocation structured logging for Go — sampling, redaction, OpenTelemetry, FingersCrossed debug-on-error, rotation, audit. A zap/zerolog/logrus/slog alter…

    Go 1

  2. errx errx Public

    One coherent structured error for Go: stable identity, class, redactable fields, return-trace, miette-style diagnostics, wire codec — zero-dep core, isolated contrib adapters.

    Go

  3. voltkit voltkit Public

    Build production-grade Go CLIs — importable kit modules + the volt tool: build, release, ship any repo layout with one command

    Go

  4. cfgkit cfgkit Public

    Typed Go configuration from layered sources — env vars, .env, JSON, YAML, TOML, flags, Vault, Consul, etcd, Kubernetes, AWS, GCP and Azure — into one validated struct. Defaults compile into the bin…

    Go

  5. sqlb sqlb Public

    Typed SQL builder for Go: compile-checked columns, joins and scan targets, zero dependencies, Postgres and ClickHouse packages, pgvector and ltree extension sub-packages, and a shared conformance s…

    Go

  6. cache cache Public

    World-class cache library for Go: bytes-level interface, generics, single-flight Remember (refresh-ahead/SWR/stale-if-error/negative/jitter), distributed Locker, pluggable codecs incl. AES-GCM, cro…

    Go

Repositories

Showing 10 of 54 repositories
  • lath Public

    A task runner whose definitions are typed Go: exported functions are the commands, pipelines are values, and a deploy runs identically on a laptop, over ssh, and in CI.

    ubgo/lath's past year of commit activity
    Go 0 Apache-2.0 0 0 0 Updated Oct 13, 2026
  • gqlkit Public

    Generate fully typed GraphQL client SDKs for Go and TypeScript — schema-first builder pattern with dynamic, compile-time-checked field selection, one shared type per GraphQL type, and no query-first codegen loop.

    ubgo/gqlkit's past year of commit activity
    Go 0 Apache-2.0 0 2 0 Updated Oct 13, 2026
  • volt-demo-lib Public

    Demo: a single-library repo released by volt — bare tags, proxy-verified, no binaries

    ubgo/volt-demo-lib's past year of commit activity
    Go 0 Apache-2.0 0 0 0 Updated Oct 13, 2026
  • volt-demo-clis Public

    Demo: a monorepo released by volt — independent CLI version streams + a nested proxy-resolvable library

    ubgo/volt-demo-clis's past year of commit activity
    Go 0 Apache-2.0 0 0 0 Updated Oct 13, 2026
  • volt-demo-cli Public

    Demo: a single-CLI repo released by volt — bare tags, generated workflows, install.sh

    ubgo/volt-demo-cli's past year of commit activity
    Shell 0 Apache-2.0 0 0 0 Updated Oct 13, 2026
  • sqlb Public

    Typed SQL builder for Go: compile-checked columns, joins and scan targets, zero dependencies, Postgres and ClickHouse packages, pgvector and ltree extension sub-packages, and a shared conformance suite that proves a driver executes what the builder renders.

    ubgo/sqlb's past year of commit activity
    Go 0 Apache-2.0 0 0 0 Updated Oct 13, 2026
  • cache-examples Public

    Runnable examples for the github.com/ubgo/cache family — in-memory, Redis, tiered, cluster, codecs, decorators, locker, observability, admin. Each example is a self-contained go run .

    ubgo/cache-examples's past year of commit activity
    Go 0 Apache-2.0 0 0 0 Updated Oct 13, 2026
  • crypt Public

    Batteries-included Go cryptography library: AES-256-GCM & ChaCha20-Poly1305 authenticated encryption, argon2id/bcrypt password hashing, HMAC & Ed25519 signing, HKDF, key rotation, KMS envelope encryption, and secure random — safe defaults, one dependency (golang.org/x/crypto), byte-for-byte interop with the TypeScript crypt-ts.

    Go 1 Apache-2.0 0 0 0 Updated Oct 13, 2026
  • voltkit Public

    Build production-grade Go CLIs — importable kit modules + the volt tool: build, release, ship any repo layout with one command

    Go 0 Apache-2.0 0 0 0 Updated Oct 13, 2026
  • threadsafecache Public

    Generic LRU + TTL cache, thread-safe, one dependency

    ubgo/threadsafecache's past year of commit activity
    Go 0 Apache-2.0 0 0 0 Updated Oct 13, 2026

Top languages

Loading…

Most used topics

Loading…