compose

module
v1.27.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2026 License: MIT

README

compose

Warning: This package is still in development and things keep changing so things may break slightly

A collection of opinionated modules created for building golang applications quicker while keeping best practices.

Why


Most applications have many components in common:

  • Loading config & env variables
  • Logging
  • Keeping a state
  • Long term storage
  • APIs
  • Authentication
  • Role management

In the spirit of keeping it DRY, this package standardizes everything so we can use the same components on every application.

Instalation


go get -u github.com/vanclief/compose
CLI

The compose binary previews API reference pages:

go install github.com/vanclief/compose/cmd/compose@latest
compose reference -head openapi.yaml -base previous.yaml -serve 127.0.0.1:8090

This serves the reference page of openapi.yaml with what changed since previous.yaml, re-rendered on every reload. Use -out page.html instead of -serve to write a standalone file.

Usage


  • config - Loading env/ settings
  • migrations - how the migration runner and its own connection pool behave, and the schema baseline that replaces old migration files

Dependencies


  • ez - Better error handling & error stack traces
  • zerolog - Lightweight and minimalistic logging
  • echo - HTTP router
  • viper - Env variables & config files

Directories

Path Synopsis
cmd
compose command
Command compose is the command line tool of the compose module.
Command compose is the command line tool of the compose module.
components
auth/oidc
Package oidc verifies OpenID Connect ID tokens from Google, Apple and Microsoft.
Package oidc verifies OpenID Connect ID tokens from Google, Apple and Microsoft.
auth/session
Package session issues and resolves rotating session tokens for first-party apps.
Package session issues and resolves rotating session tokens for first-party apps.
auth/token
Package token generates and checks opaque bearer tokens.
Package token generates and checks opaque bearer tokens.
mcp
Package mcp exposes a REST API described by an OpenAPI 3.x document as a Model Context Protocol server with a fixed set of tools:
Package mcp exposes a REST API described by an OpenAPI 3.x document as a Model Context Protocol server with a fixed set of tools:
mcp/oauth
Package oauth lets hosted MCP clients such as claude.ai and ChatGPT connect to a compose MCP server.
Package oauth lets hosted MCP clients such as claude.ai and ChatGPT connect to a compose MCP server.
rest/generator
Package generator derives an OpenAPI 3.0 document from the source of an Echo application built on compose's rest handlers.
Package generator derives an OpenAPI 3.0 document from the source of an Echo application built on compose's rest handlers.
rest/reference
Package reference renders an OpenAPI 3.x document as a self-hosted API reference page: an alternative to Scalar and Redoc that ships inside the backend, with no CDN assets.
Package reference renders an OpenAPI 3.x document as a self-hosted API reference page: an alternative to Scalar and Redoc that ships inside the backend, with no CDN assets.
drivers
databases/relational/internal/jsonfmt
Package jsonfmt holds the JSON formatter the compose dialects use in place of bun v1.3.0's, which mis-escapes the text \u0000 (https://github.com/uptrace/bun/issues/1472).
Package jsonfmt holds the JSON formatter the compose dialects use in place of bun v1.3.0's, which mis-escapes the text \u0000 (https://github.com/uptrace/bun/issues/1472).
integrations
primitives
enums
Package enums validates string-backed enums and adapts them to JSON and database/sql.
Package enums validates string-backed enums and adapts them to JSON and database/sql.
utils

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL