platform-go

module
v10.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: AGPL-3.0

README

platform-go

Go Reference codecov

A Go library providing infrastructure abstractions for cloud-native services. Each package defines a stable interface with one or more provider implementations, selected at runtime via config. Layers that touch the network — HTTP, gRPC, database, messaging — instrument with OpenTelemetry.

Module: github.com/primandproper/platform-go/v10 Go: 1.26

Project Status & Stability

main is not a release channel. Anything on main that has not been cut into a tagged release is considered under active development — alpha/beta, unstable, and unsupported. Treat it as such.

This repository follows a deliberately conservative release model:

  • Only tagged releases are supported. If it isn't behind a version tag, it can change or break without notice, and no support or compatibility is promised for it.
  • main moves ahead of the latest release. New work — including breaking changes — lands on main well before it is deemed release-worthy. Two facts locate you at any moment, and both are derived rather than written down here: the module path in go.mod is the major that main is currently building toward, and the highest version tag is the latest supported release. Whatever is on main but not yet in that tag is subject to change — and immediately after a major bump, that is the entire major.
  • Semantic Versioning, enforced by Go's module paths. Breaking changes increment the major version and the module import path (/vN/vN+1), so a major bump can never silently break a consumer that hasn't opted in. The path bump lands in the same change that makes the break, never as a follow-up, which is why main's major is frequently one ahead of anything you can fetch by tag.
  • No stability guarantees on unreleased APIs. Interfaces, config shapes, and package boundaries on main are subject to change until they ship in a release.

If you depend on this library, pin to a released tag — and note that @latest against a major that has no tag yet resolves to a commit on main rather than to a release. If you want to track upcoming work, main is fair game — just don't expect it to hold still.

Installation

go get github.com/primandproper/platform-go/v10@latest

Because breaking changes ride the major-version import path, upgrading across majors is an explicit, opt-in edit to your import paths — never a surprise from go get -u.

Design Patterns

Interface + implementations. Every major concern is defined as an interface (e.g., cache.Cache[T], logging.Logger, secrets.SecretSource), with provider implementations in subpackages. Swap implementations via config without touching call sites. Most packages ship a noop implementation for tests and for cleanly disabling a concern.

Config structs. Each package has a config subpackage with env:-tagged structs and ValidateWithContext() (via go-ozzo/ozzo-validation). Configuration is the seam that selects an implementation. Most, but not all, also have EnsureDefaults() — packages whose defaults are expressible as envDefault: tags use those instead.

Selecting an implementation is deliberate: an unrecognized provider name returns errors.ErrUnknownProvider rather than a working-looking noop, because a typo that silently discards every message or never limits a request is a production incident that looks like a healthy process. Where a noop is genuinely wanted it has to be asked for by name.

OpenTelemetry throughout. HTTP, gRPC, database, and messaging layers emit traces and metrics. Observability primitives (logging, tracing, metrics, profiling) live under observability/.

Error handling. Uses cockroachdb/errors for rich, wrapped error context. Platform-level sentinel errors live in errors/, conventionally imported as platformerrors. Transport mappings live in errors/http and errors/grpc, which import the packages whose sentinels they map — so nothing in those packages may import them back.

Package Catalog

Implementations are listed in parentheses; most concerns also provide a noop.

Data & storage
Package Purpose Implementations
database SQL access + instrumentation postgres, mysql, sqlite
cache Generic key/value cache (Cache[T]) redis, memory
uploads Blob/object storage & image handling objectstorage (S3-compatible), images
files Filesystem & streaming helpers
secrets Secret sourcing (+ caching/rotation) env, gcp, ssm, kubernetes
Messaging & events
Package Purpose Implementations
messagequeue Publish/subscribe & queues kafka, pubsub, redis, sqs
outbox Transactional outbox postgres, mysql, sqlite
eventstream Server push to clients sse, websocket
notifications User notifications async, mobile
jobs Queue workers & periodic jobs
email Transactional email mailgun, mailjet, postmark, resend, sendgrid, ses
Web & transport
Package Purpose Implementations
server Service servers grpc, http
routing HTTP router abstraction chi, stdlib, httprouter, gin
httpclient Instrumented HTTP client
cookies Cookie management
encoding Content encoding/decoding
compression Payload compression
ratelimiting Request rate limiting redis
circuitbreaking Circuit breaker
retry Retry with backoff
idempotency At-most-once effect for retried requests http, grpc (server + client)
Observability & operations
Package Purpose Implementations
observability Logging, tracing, metrics, profiling logging (slog, zap, zerolog); OTel tracing/metrics
healthcheck Health/readiness checks
version Build/version metadata
metering Durable usage metering & quotas postgres, mysql, sqlite
webhooks Outbound webhook delivery postgres, mysql, sqlite
webhooks/inbound Inbound webhook receipt: verify, publish, ack stripe, github, generic HMAC
clock Injectable time
config Config loading & env parsing
Auth & security
Package Purpose Implementations
authentication Password hashing, TOTP, tokens argon2, totp, tokens
authentication/webauthn Passkey registration & login, with ceremony state that outlives one replica database, cache
sessions Server-side sessions over cookies cache, database (+ http)
authorization Role/permission policy, enforcement static (default), database
links Signed, expiring, single-use action links cache + distributedlock
audit Tamper-evident audit log postgres, mysql, sqlite
cryptography Cryptographic primitives encryption (aes, kms), hashing
cryptography/requestsigning HMAC request signing & verification v1
cryptography/shredding Per-subject data keys that can be destroyed postgres, mysql, sqlite
random Secure randomness
identifiers ID generation
dataprivacy Subject access & erasure requests postgres, mysql, sqlite
retention Policy-driven expiry deletion postgres, mysql, sqlite
AI, ML & product
Package Purpose Implementations
llm Large language model clients anthropic, openai
embeddings Embedding generation cohere, ollama, openai
search Vector / text search vector, text
analytics Product analytics posthog, segment, multisource
featureflags Feature flagging launchdarkly, posthog
Domain & coordination
Package Purpose Implementations
capitalism Payments stripe
entitlements Feature access & remaining quota
saga Linear durable sagas with compensations postgres, mysql, sqlite
distributedlock Distributed locking memory, postgres, redis
workqueue Leased work queue (SKIP LOCKED claim/complete/expire) postgres
timers Durable one-shot scheduling (run once at time T, fleet-wide) postgres
operations Long-running operations with durable state, two-tier progress, and streamed updates postgres
filtering Query filters / pagination
qrcodes QR code generation
eventcapture Recording domain events jsonl
Utilities

errors, pointer, numbers, bitmask, charset, reflection, panicking, testutils, fake.

Development

make setup          # Install dev tools and vendor deps
make format         # Format all Go code (imports, field/tag alignment, gofmt)
make lint           # Run golangci-lint (Docker) + shellcheck
make test           # Run tests (race detector, shuffle, failfast)
make build          # Build all packages
make generate       # Regenerate moq mocks after changing a mocked interface
make bench          # Run benchmarks
make revendor       # Clean and re-vendor dependencies

Formatting runs locally with gci, goimports, betteralign, tagalign, and gofmt. Linting runs in Docker against the golangci/golangci-lint image (42+ linters, golangci-lint v2 format).

Testing conventions
  • stretchr/testify is banned (assert, require, and mock), enforced by depguard. Use shoenig/test for assertions (test for non-fatal, must for fatal) and matryer/moq for mocks.
  • Tests run in parallel by default and use subtests throughout.
  • Container-backed tests use testcontainers-go, live in-package (typically containers_test.go), and gate on RUN_CONTAINER_TESTS=true.
  • make test runs CGO_ENABLED=1 go test -shuffle=on -race -vet=all -failfast ./... across every package. .scripts/test.sh false runs the suite without container tests.

Contributing

Because main is a development channel and only tagged releases are supported, changes land on main freely and are stabilized before release. Follow the existing package layout (interface + config subpackage + provider implementations + noop), match the surrounding code, and keep make format lint test green.

Directories

Path Synopsis
Package analytics provides an event reporting interface for collecting and tracking customer data and events.
Package analytics provides an event reporting interface for collecting and tracking customer data and events.
config
Package analyticscfg selects and builds an analytics.EventReporter from configuration — Segment, PostHog, or the noop reporter — handing the vendor implementations a circuit breaker built from the same config.
Package analyticscfg selects and builds an analytics.EventReporter from configuration — Segment, PostHog, or the noop reporter — handing the vendor implementations a circuit breaker built from the same config.
mock
Package analyticsmock provides moq-generated mocks for the analytics package.
Package analyticsmock provides moq-generated mocks for the analytics package.
multisource
Package multisource fans analytics events out to one reporter per named source.
Package multisource fans analytics events out to one reporter per named source.
noop
Package noop is the analytics.EventReporter for a deployment that measures nothing.
Package noop is the analytics.EventReporter for a deployment that measures nothing.
posthog
Package posthog reports analytics events to PostHog.
Package posthog reports analytics events to PostHog.
segment
Package segment reports analytics events to Segment.
Package segment reports analytics events to Segment.
Package audit is the durable, queryable, tamper-evident record of who did what to which resource.
Package audit is the durable, queryable, tamper-evident record of who did what to which resource.
config
Package auditcfg assembles the audit log from environment configuration: the Recorder applications write through, the Reader they query and verify with, and the retention.Policy that prunes it.
Package auditcfg assembles the audit log from environment configuration: the Recorder applications write through, the Reader they query and verify with, and the retention.Policy that prunes it.
migrations
Package migrations supplies the audit tables' DDL, rendered for a dialect and table prefix.
Package migrations supplies the audit tables' DDL, rendered for a dialect and table prefix.
mock
Package auditmock provides moq-generated mock implementations of interfaces in the audit package.
Package auditmock provides moq-generated mock implementations of interfaces in the audit package.
Package authentication defines interfaces for password hashing and credential verification.
Package authentication defines interfaces for password hashing and credential verification.
argon2
Package argon2 is the argon2id authentication.Authenticator: the password hasher this module recommends, and the only implementation of that interface it ships.
Package argon2 is the argon2id authentication.Authenticator: the password hasher this module recommends, and the only implementation of that interface it ships.
oauth2server
Package oauth2server is an OAuth 2.1 authorization server: the endpoints, the grant logic, and a Store seam underneath them.
Package oauth2server is an OAuth 2.1 authorization server: the endpoints, the grant logic, and a Store seam underneath them.
oauth2server/config
Package oauth2servercfg assembles an OAuth 2.1 authorization server, and the Store behind it, from environment configuration.
Package oauth2servercfg assembles an OAuth 2.1 authorization server, and the Store behind it, from environment configuration.
oauth2server/database
Package database keeps an authorization server's state in SQL tables.
Package database keeps an authorization server's state in SQL tables.
oauth2server/database/migrations
Package migrations supplies the authorization server's DDL, rendered for a dialect and table prefix.
Package migrations supplies the authorization server's DDL, rendered for a dialect and table prefix.
oauth2server/memory
Package memory keeps an authorization server's state in maps.
Package memory keeps an authorization server's state in maps.
oauth2server/oauth2servertest
Package oauth2servertest holds the behavior every oauth2server.Store owes its callers, written once and run against each implementation.
Package oauth2servertest holds the behavior every oauth2server.Store owes its callers, written once and run against each implementation.
tokens
Package tokens is the seam for bearer tokens: an Issuer mints them and parses them back, and the jwt and paseto subpackages implement it.
Package tokens is the seam for bearer tokens: an Issuer mints them and parses them back, and the jwt and paseto subpackages implement it.
tokens/config
Package tokenscfg selects and builds a tokens.Issuer from configuration: either the JWT signer or the PASETO one.
Package tokenscfg selects and builds a tokens.Issuer from configuration: either the JWT signer or the PASETO one.
tokens/jwt
Package jwt is the HS256 tokens.Issuer: JSON Web Tokens signed with a shared secret.
Package jwt is the HS256 tokens.Issuer: JSON Web Tokens signed with a shared secret.
tokens/mock
Package tokensmock provides moq-generated mock implementations of interfaces in the tokens package.
Package tokensmock provides moq-generated mock implementations of interfaces in the tokens package.
tokens/paseto
Package paseto is the PASETO v2.local tokens.Issuer: tokens whose claims are encrypted rather than merely signed.
Package paseto is the PASETO v2.local tokens.Issuer: tokens whose claims are encrypted rather than merely signed.
totp
Package totp provides a TOTP (RFC 6238) second-factor verifier.
Package totp provides a TOTP (RFC 6238) second-factor verifier.
totp/mock
Package totpmock provides moq-generated mock implementations of interfaces in the totp package.
Package totpmock provides moq-generated mock implementations of interfaces in the totp package.
webauthn
Package webauthn provides passkey registration and login over github.com/go-webauthn/webauthn, and the ceremony store that makes it work on more than one replica.
Package webauthn provides passkey registration and login over github.com/go-webauthn/webauthn, and the ceremony store that makes it work on more than one replica.
webauthn/cache
Package cache stores WebAuthn ceremony state in a cache.Cache.
Package cache stores WebAuthn ceremony state in a cache.Cache.
webauthn/config
Package webauthncfg assembles a WebAuthn relying party, and the ceremony store under it, from environment configuration.
Package webauthncfg assembles a WebAuthn relying party, and the ceremony store under it, from environment configuration.
webauthn/database
Package database stores WebAuthn ceremony state in a SQL table.
Package database stores WebAuthn ceremony state in a SQL table.
webauthn/database/migrations
Package migrations supplies the WebAuthn ceremony session table's DDL, rendered for a dialect and table prefix.
Package migrations supplies the WebAuthn ceremony session table's DDL, rendered for a dialect and table prefix.
webauthn/mock
Package webauthnmock provides moq-generated mock implementations of interfaces in the webauthn package.
Package webauthnmock provides moq-generated mock implementations of interfaces in the webauthn package.
webauthn/webauthntest
Package webauthntest holds the behavior every webauthn.SessionStore owes its callers, written once and run against each implementation.
Package webauthntest holds the behavior every webauthn.SessionStore owes its callers, written once and run against each implementation.
Package authorization answers "may this principal do this thing".
Package authorization answers "may this principal do this thing".
cached
Package cached wraps any authorization.PolicyResolver in a cache.
Package cached wraps any authorization.PolicyResolver in a cache.
config
Package authorizationcfg selects and builds an authorization.PolicyResolver from configuration.
Package authorizationcfg selects and builds an authorization.PolicyResolver from configuration.
database
Package database stores authorization policy in SQL tables.
Package database stores authorization policy in SQL tables.
database/migrations
Package migrations supplies the authorization policy tables' DDL, rendered for a dialect and table prefix.
Package migrations supplies the authorization policy tables' DDL, rendered for a dialect and table prefix.
grpc
Package grpc enforces authorization on gRPC methods.
Package grpc enforces authorization on gRPC methods.
http
Package http enforces authorization on HTTP routes.
Package http enforces authorization on HTTP routes.
mock
Package authorizationmock provides moq-generated mock implementations of interfaces in the authorization package.
Package authorizationmock provides moq-generated mock implementations of interfaces in the authorization package.
static
Package static provides an authorization.PolicyResolver whose policy is fixed at construction.
Package static provides an authorization.PolicyResolver whose policy is fixed at construction.
Package batching merges concurrent writes against a narrow key space into one write per process.
Package batching merges concurrent writes against a narrow key space into one write per process.
Package bitmask provides a generic, immutable bitmask type with set operations for unsigned integer types.
Package bitmask provides a generic, immutable bitmask type with set operations for unsigned integer types.
Package cache provides a generic caching interface with support for multiple backend implementations including Redis and in-memory stores.
Package cache provides a generic caching interface with support for multiple backend implementations including Redis and in-memory stores.
config
Package cachecfg selects and builds a cache.Cache[T] from configuration: either the in-process memory cache or Redis.
Package cachecfg selects and builds a cache.Cache[T] from configuration: either the in-process memory cache or Redis.
memory
Package memory is a cache.Cache held in a map in this process.
Package memory is a cache.Cache held in a map in this process.
mock
Package cachemock provides moq-generated mock implementations of interfaces in the cache package.
Package cachemock provides moq-generated mock implementations of interfaces in the cache package.
noop
Package noop is the cache.Cache for a caller who wants no cache at all: every read misses and every write is accepted and forgotten.
Package noop is the cache.Cache for a caller who wants no cache at all: every read misses and every write is accepted and forgotten.
redis
Package redis is a cache.Cache backed by Redis, in either single-node or cluster mode.
Package redis is a cache.Cache backed by Redis, in either single-node or cluster mode.
redis/slots
Package slots produces Redis Cluster keys whose slots are pre-planned to distribute evenly across the cluster's nodes.
Package slots produces Redis Cluster keys whose slots are pre-planned to distribute evenly across the cluster's nodes.
Package capitalism provides a payment management interface for handling subscription plans and payment provider webhooks.
Package capitalism provides a payment management interface for handling subscription plans and payment provider webhooks.
config
Package capitalismcfg builds both halves of the payments seam from one configuration — a capitalism.PaymentManager and a capitalism.UsageReporter — over Stripe or the noop provider.
Package capitalismcfg builds both halves of the payments seam from one configuration — a capitalism.PaymentManager and a capitalism.UsageReporter — over Stripe or the noop provider.
mock
Package capitalismmock provides mock implementations of the capitalism package's interfaces.
Package capitalismmock provides mock implementations of the capitalism package's interfaces.
noop
Package noop holds the capitalism implementations a deployment that does not bill runs, and the two are deliberately unalike.
Package noop holds the capitalism implementations a deployment that does not bill runs, and the two are deliberately unalike.
stripe
Package stripe provides Stripe functionality.
Package stripe provides Stripe functionality.
Package charset states which characters a string may be made of, as a value rather than as a loop written out again at every place that needs one.
Package charset states which characters a string may be made of, as a value rather than as a loop written out again at every place that needs one.
Package circuitbreaking implements the circuit breaker pattern for managing service availability and preventing cascading failures.
Package circuitbreaking implements the circuit breaker pattern for managing service availability and preventing cascading failures.
config
Package circuitbreakingcfg builds a circuitbreaking.CircuitBreaker from configuration.
Package circuitbreakingcfg builds a circuitbreaking.CircuitBreaker from configuration.
mock
Package circuitbreakingmock provides moq-generated mock implementations of the circuitbreaking package's interfaces.
Package circuitbreakingmock provides moq-generated mock implementations of the circuitbreaking package's interfaces.
noop
Package noop is the circuitbreaking.CircuitBreaker that never opens: CanProceed is always true, no matter how many failures are reported to it.
Package noop is the circuitbreaking.CircuitBreaker that never opens: CanProceed is always true, no matter how many failures are reported to it.
partitioned
Package partitioned provides a circuit breaker that is partitioned by key.
Package partitioned provides a circuit breaker that is partitioned by key.
partitioned/config
Package partitionedcfg builds a partitioned.KeyedCircuitBreaker from one base circuitbreakingcfg.Config: a breaker per declared key, plus a global one that every undeclared key shares.
Package partitionedcfg builds a partitioned.KeyedCircuitBreaker from one base circuitbreakingcfg.Config: a breaker per declared key, plus a global one that every undeclared key shares.
partitioned/mock
Package partitionedmock provides a moq-generated mock implementation of the partitioned package's KeyedCircuitBreaker interface.
Package partitionedmock provides a moq-generated mock implementation of the partitioned package's KeyedCircuitBreaker interface.
partitioned/noop
Package noop is the partitioned.KeyedCircuitBreaker that never opens for any key.
Package noop is the partitioned.KeyedCircuitBreaker that never opens for any key.
Package clock provides an injectable source of time so components that stamp, pace, or schedule work can be tested deterministically.
Package clock provides an injectable source of time so components that stamp, pace, or schedule work can be tested deterministically.
mock
Package clockmock provides moq-generated mock implementations of the clock package's interfaces.
Package clockmock provides moq-generated mock implementations of the clock package's interfaces.
Package compression provides data compression and decompression using Zstd and S2 algorithms.
Package compression provides data compression and decompression using Zstd and S2 algorithms.
Package config provides helpers for populating configuration structs from environment variables, .env files, and JSON, TOML, or YAML files.
Package config provides helpers for populating configuration structs from environment variables, .env files, and JSON, TOML, or YAML files.
envvars
Package envvars derives the closed set of environment variables that can override a configuration struct, and writes it out as Go constants.
Package envvars derives the closed set of environment variables that can override a configuration struct, and writes it out as Go constants.
Package cookies encodes values into cookies that a browser can hold and this service can later trust, and builds the *http.Cookie carrying them.
Package cookies encodes values into cookies that a browser can hold and this service can later trust, and builds the *http.Cookie carrying them.
config
Package cookiescfg registers a cookies.Manager with a do injector.
Package cookiescfg registers a cookies.Manager with a do injector.
cryptography
encryption
Package encryption provides authenticated encryption over a rotatable set of keys.
Package encryption provides authenticated encryption over a rotatable set of keys.
encryption/aes
Package aes contains the interfaces and implementations for encrypting and decrypting data.
Package aes contains the interfaces and implementations for encrypting and decrypting data.
encryption/config
Package encryptioncfg builds an encryption keyring over a caller-supplied encryption.Keyset, with one cipher provider — AES-256-GCM today — governing every key in the ring.
Package encryptioncfg builds an encryption keyring over a caller-supplied encryption.Keyset, with one cipher provider — AES-256-GCM today — governing every key in the ring.
encryption/kms
Package kms groups the encryption.KeyWrapper implementations.
Package kms groups the encryption.KeyWrapper implementations.
encryption/kms/aws
Package aws wraps key material with AWS KMS.
Package aws wraps key material with AWS KMS.
encryption/kms/gcp
Package gcp wraps key material with Google Cloud KMS.
Package gcp wraps key material with Google Cloud KMS.
encryption/kms/local
Package local wraps key material with an encryption.Cipher held in this process.
Package local wraps key material with an encryption.Cipher held in this process.
encryption/mock
Package encryptionmock provides moq-generated mock implementations of the encryption package's interfaces.
Package encryptionmock provides moq-generated mock implementations of the encryption package's interfaces.
hashing
Package hashing is the seam for reducing content to a digest, so that which algorithm computes it can be a runtime choice.
Package hashing is the seam for reducing content to a digest, so that which algorithm computes it can be a runtime choice.
hashing/adler32
Package adler32 implements hashing.Hasher using the Adler-32 checksum.
Package adler32 implements hashing.Hasher using the Adler-32 checksum.
hashing/canonical
Package canonical hashes Go values by content, producing the same digest for semantically identical values regardless of which process built them, in what order, or how their types declare fields.
Package canonical hashes Go values by content, producing the same digest for semantically identical values regardless of which process built them, in what order, or how their types declare fields.
hashing/crc64
Package crc64 implements hashing.Hasher using the CRC-64 (ISO) checksum, and exposes ChecksumISO for callers that want the checksum as the integer it natively is.
Package crc64 implements hashing.Hasher using the CRC-64 (ISO) checksum, and exposes ChecksumISO for callers that want the checksum as the integer it natively is.
hashing/fnv
Package fnv implements hashing.Hasher using the FNV-1a hash, and exposes Sum64a and Sum128a for callers that want the hash as the integer it natively is.
Package fnv implements hashing.Hasher using the FNV-1a hash, and exposes Sum64a and Sum128a for callers that want the hash as the integer it natively is.
hashing/hmac
Package hmac provides keyed hashing.Hasher implementations, for the cases where a digest has to prove who computed it rather than only what was computed.
Package hmac provides keyed hashing.Hasher implementations, for the cases where a digest has to prove who computed it rather than only what was computed.
hashing/sha256
Package sha256 implements hashing.Hasher using SHA-256, producing a 32-byte digest.
Package sha256 implements hashing.Hasher using SHA-256, producing a 32-byte digest.
hashing/sha512
Package sha512 implements hashing.Hasher using SHA-512, producing a 64-byte digest.
Package sha512 implements hashing.Hasher using SHA-512, producing a 64-byte digest.
requestsigning
Package requestsigning proves that an HTTP request body was produced by someone holding a shared key, and that it was produced recently.
Package requestsigning proves that an HTTP request body was produced by someone holding a shared key, and that it was produced recently.
requestsigning/http
Package http adapts requestsigning to inbound HTTP.
Package http adapts requestsigning to inbound HTTP.
shredding
Package shredding provides per-subject data keys that can be destroyed, so that erasure reaches media nothing can write to.
Package shredding provides per-subject data keys that can be destroyed, so that erasure reaches media nothing can write to.
shredding/config
Package shreddingcfg assembles per-subject data keys from environment configuration: the Store the keys live in, the Keys surface that uses them, and the Broadcaster that tells the rest of the fleet when one is destroyed.
Package shreddingcfg assembles per-subject data keys from environment configuration: the Store the keys live in, the Keys surface that uses them, and the Broadcaster that tells the rest of the fleet when one is destroyed.
shredding/migrations
Package migrations supplies the subject-key table's DDL, rendered for a dialect and table prefix.
Package migrations supplies the subject-key table's DDL, rendered for a dialect and table prefix.
shredding/mock
Package shreddingmock provides moq-generated mock implementations of the shredding package's interfaces.
Package shreddingmock provides moq-generated mock implementations of the shredding package's interfaces.
Package database provides interface abstractions for interacting with relational data stores
Package database provides interface abstractions for interacting with relational data stores
config
Package databasecfg selects and builds a database.Client — Postgres, MySQL, or SQLite — and owns the connection strings each of them wants.
Package databasecfg selects and builds a database.Client — Postgres, MySQL, or SQLite — and owns the connection strings each of them wants.
ddl
Package ddl renders a package's embedded schema against a dialect and a table prefix, and vets the prefix against every identifier the schema would create.
Package ddl renders a package's embedded schema against a dialect and a table prefix, and vets the prefix against every identifier the schema would create.
dialect
Package dialect names the SQL dialects the module's SQL-emitting packages support, and carries the small helpers every one of them otherwise reimplements: bind-marker rendering, identifier vetting, and DDL statement splitting.
Package dialect names the SQL dialects the module's SQL-emitting packages support, and carries the small helpers every one of them otherwise reimplements: bind-marker rendering, identifier vetting, and DDL statement splitting.
internal/sqlclient
Package sqlclient holds the parts of a database.Client that do not vary by SQL driver.
Package sqlclient holds the parts of a database.Client that do not vary by SQL driver.
migrate
Package migrate provides the platform's standard database.Migrator: embedded SQL migrations with the operational discipline consumers otherwise hand-roll — an instance-based provider (no global goose state, so parallel tests never race), and on Postgres a session advisory lock that serializes concurrently booting replicas, with probe timeouts tightened so a waiting replica notices the winner promptly instead of goose's leisurely default.
Package migrate provides the platform's standard database.Migrator: embedded SQL migrations with the operational discipline consumers otherwise hand-roll — an instance-based provider (no global goose state, so parallel tests never race), and on Postgres a session advisory lock that serializes concurrently booting replicas, with probe timeouts tightened so a waiting replica notices the winner promptly instead of goose's leisurely default.
mock
Package databasemock provides moq-generated mocks for the database package.
Package databasemock provides moq-generated mocks for the database package.
mysql
Package mysql provides an interface for writing to a MySQL instance.
Package mysql provides an interface for writing to a MySQL instance.
mysql/tableaccess
Package tableaccess is the MySQL database.Manager: the administrative surface that creates users and databases and grants table privileges, as distinct from the query path a database.Client serves.
Package tableaccess is the MySQL database.Manager: the administrative surface that creates users and databases and grants table privileges, as distinct from the query path a database.Client serves.
postgres
Package postgres provides an interface for writing to a Postgres instance.
Package postgres provides an interface for writing to a Postgres instance.
postgres/pgnotify
Package pgnotify turns Postgres LISTEN/NOTIFY into a wake-up signal for a poller.
Package pgnotify turns Postgres LISTEN/NOTIFY into a wake-up signal for a poller.
postgres/tableaccess
Package tableaccess is the PostgreSQL database.Manager: the administrative surface that creates roles and databases and grants table privileges, as distinct from the query path a database.Client serves.
Package tableaccess is the PostgreSQL database.Manager: the administrative surface that creates roles and databases and grants table privileges, as distinct from the query path a database.Client serves.
querygen
Package querygen emits sqlc input for tables shaped the way this module's row conventions expect.
Package querygen emits sqlc input for tables shaped the way this module's row conventions expect.
sqlite
Package sqlite provides an interface for writing to a SQLite database.
Package sqlite provides an interface for writing to a SQLite database.
sqlite/tableaccess
Package tableaccess is the SQLite database.Manager, and every one of its operations refuses.
Package tableaccess is the SQLite database.Manager, and every one of its operations refuses.
Package dataprivacy fulfills GDPR and CCPA subject access and erasure requests as durable, auditable operations.
Package dataprivacy fulfills GDPR and CCPA subject access and erasure requests as durable, auditable operations.
auditerasure
Package auditerasure supplies a dataprivacy.Eraser for the audit log.
Package auditerasure supplies a dataprivacy.Eraser for the audit log.
config
Package dataprivacycfg assembles the data privacy machinery from environment configuration: the Store every part shares, the Service applications submit through, the Fulfiller that does the work, and the Sweeper that expires.
Package dataprivacycfg assembles the data privacy machinery from environment configuration: the Store every part shares, the Service applications submit through, the Fulfiller that does the work, and the Sweeper that expires.
migrations
Package migrations supplies the data-privacy request table's DDL, rendered for a dialect and table prefix.
Package migrations supplies the data-privacy request table's DDL, rendered for a dialect and table prefix.
mock
Package dataprivacymock provides moq-generated mock implementations of interfaces in the dataprivacy package.
Package dataprivacymock provides moq-generated mock implementations of interfaces in the dataprivacy package.
Package distributedlock provides a pessimistic mutual-exclusion atom for coordinating exclusive access to a named resource across processes.
Package distributedlock provides a pessimistic mutual-exclusion atom for coordinating exclusive access to a named resource across processes.
config
Package distributedlockcfg selects and builds a distributedlock.Locker, or a ScopedLocker, from configuration: Redis, Postgres, memory, or noop.
Package distributedlockcfg selects and builds a distributedlock.Locker, or a ScopedLocker, from configuration: Redis, Postgres, memory, or noop.
distributedlocktest
Package distributedlocktest holds the behavior every distributedlock.Locker and distributedlock.ScopedLocker owes its callers, written once and run against each implementation.
Package distributedlocktest holds the behavior every distributedlock.Locker and distributedlock.ScopedLocker owes its callers, written once and run against each implementation.
memory
Package memory implements distributedlock.Locker over a map and a mutex.
Package memory implements distributedlock.Locker over a map and a mutex.
mock
Package distributedlockmock provides moq-generated mock implementations of the distributedlock package's interfaces.
Package distributedlockmock provides moq-generated mock implementations of the distributedlock package's interfaces.
noop
Package noop is the distributedlock implementation for a deployment with nothing to coordinate with: Acquire always succeeds immediately, WithLock always runs fn, and TryWithLock always reports the lock as taken.
Package noop is the distributedlock implementation for a deployment with nothing to coordinate with: Acquire always succeeds immediately, WithLock always runs fn, and TryWithLock always reports the lock as taken.
postgres
Package postgres implements distributedlock.Locker against PostgreSQL session- scoped advisory locks (pg_try_advisory_lock).
Package postgres implements distributedlock.Locker against PostgreSQL session- scoped advisory locks (pg_try_advisory_lock).
redis
Package redis implements distributedlock.Locker with a single Redis key per lock.
Package redis implements distributedlock.Locker with a single Redis key per lock.
Package email provides an interface for sending emails, with implementations for Mailgun, Mailjet, Postmark, Resend, and SendGrid.
Package email provides an interface for sending emails, with implementations for Mailgun, Mailjet, Postmark, Resend, and SendGrid.
config
Package emailcfg selects and builds an email.Emailer from configuration over six vendors — SendGrid, Mailgun, Mailjet, Resend, Postmark, SES — or the noop emailer.
Package emailcfg selects and builds an email.Emailer from configuration over six vendors — SendGrid, Mailgun, Mailjet, Resend, Postmark, SES — or the noop emailer.
mailgun
Package mailgun sends email through Mailgun.
Package mailgun sends email through Mailgun.
mailjet
Package mailjet sends email through Mailjet.
Package mailjet sends email through Mailjet.
mock
Package emailmock provides moq-generated mock implementations of the email package's interfaces.
Package emailmock provides moq-generated mock implementations of the email package's interfaces.
noop
Package noop is the email.Emailer that sends nothing.
Package noop is the email.Emailer that sends nothing.
postmark
Package postmark sends email through Postmark.
Package postmark sends email through Postmark.
resend
Package resend sends email through Resend.
Package resend sends email through Resend.
sendgrid
Package sendgrid sends email through SendGrid.
Package sendgrid sends email through SendGrid.
ses
Package ses sends email through Amazon SES v2.
Package ses sends email through Amazon SES v2.
Package embeddings provides a vector embedding interface with implementations for OpenAI, Ollama, and Cohere providers.
Package embeddings provides a vector embedding interface with implementations for OpenAI, Ollama, and Cohere providers.
cohere
Package cohere generates vector embeddings through Cohere's v2 embed API.
Package cohere generates vector embeddings through Cohere's v2 embed API.
config
Package embeddingscfg selects and builds an embeddings.Embedder from configuration: OpenAI, Ollama, Cohere, or the noop embedder.
Package embeddingscfg selects and builds an embeddings.Embedder from configuration: OpenAI, Ollama, Cohere, or the noop embedder.
mock
Package embeddingsmock provides moq-generated mock implementations of the embeddings package's interfaces.
Package embeddingsmock provides moq-generated mock implementations of the embeddings package's interfaces.
noop
Package noop is the embeddings.Embedder for a deployment that runs no model, and the thing to know is that it does not return nothing.
Package noop is the embeddings.Embedder for a deployment that runs no model, and the thing to know is that it does not return nothing.
ollama
Package ollama generates vector embeddings through a running Ollama instance.
Package ollama generates vector embeddings through a running Ollama instance.
openai
Package openai generates vector embeddings through OpenAI's embeddings API.
Package openai generates vector embeddings through OpenAI's embeddings API.
Package encoding turns values into bytes and back, in a content type chosen by configuration rather than by the call site.
Package encoding turns values into bytes and back, in a content type chosen by configuration rather than by the call site.
mock
Package encodingmock provides moq-generated mocks for the encoding package.
Package encodingmock provides moq-generated mocks for the encoding package.
Package entitlements answers "may this account use this feature, and how much is left".
Package entitlements answers "may this account use this feature, and how much is left".
config
Package entitlementscfg assembles the entitlements machinery from configuration: the Catalog plans are read into, the Checker that answers questions against it, and the metering.QuotaSource that keeps metering enforcing the catalog's limits rather than its own.
Package entitlementscfg assembles the entitlements machinery from configuration: the Catalog plans are read into, the Checker that answers questions against it, and the metering.QuotaSource that keeps metering enforcing the catalog's limits rather than its own.
mock
Package entitlementsmock provides moq-generated mock implementations of interfaces in the entitlements package.
Package entitlementsmock provides moq-generated mock implementations of interfaces in the entitlements package.
Package errors re-exports cockroachdb/errors utilities and defines platform-level sentinel error values and HTTP/gRPC error conversion helpers.
Package errors re-exports cockroachdb/errors utilities and defines platform-level sentinel error values and HTTP/gRPC error conversion helpers.
grpc
Package grpc translates errors into gRPC statuses, and back again on the other side of the wire.
Package grpc translates errors into gRPC statuses, and back again on the other side of the wire.
http
Package http translates errors into HTTP responses, in both directions.
Package http translates errors into HTTP responses, in both directions.
Package eventcapture records high-volume operational events for offline analysis — model training data, usage matrices, replayable traces — without ever slowing the request path that produces them.
Package eventcapture records high-volume operational events for offline analysis — model training data, usage matrices, replayable traces — without ever slowing the request path that produces them.
jsonl
Package jsonl implements eventcapture.Sink as an append-only, size-rotated, newline-delimited JSON file.
Package jsonl implements eventcapture.Sink as an append-only, size-rotated, newline-delimited JSON file.
mock
Package eventcapturemock provides moq-generated mock implementations of the eventcapture package's interfaces.
Package eventcapturemock provides moq-generated mock implementations of the eventcapture package's interfaces.
noop
Package noop provides a no-op eventcapture.Sink, for deployments with capture wired but disabled.
Package noop provides a no-op eventcapture.Sink, for deployments with capture wired but disabled.
Package eventstream provides event streaming abstractions for server-to-client and bidirectional communication over HTTP, with implementations for SSE and WebSocket.
Package eventstream provides event streaming abstractions for server-to-client and bidirectional communication over HTTP, with implementations for SSE and WebSocket.
config
Package eventstreamcfg selects and builds an eventstream upgrader from configuration: SSE or WebSocket.
Package eventstreamcfg selects and builds an eventstream upgrader from configuration: SSE or WebSocket.
noop
Package noop is the eventstream implementation for a caller with no transport to stream over.
Package noop is the eventstream implementation for a caller with no transport to stream over.
sse
Package sse upgrades an HTTP request to a Server-Sent Events stream.
Package sse upgrades an HTTP request to a Server-Sent Events stream.
websocket
Package websocket upgrades an HTTP request to a WebSocket event stream, over gorilla/websocket.
Package websocket upgrades an HTTP request to a WebSocket event stream, over gorilla/websocket.
Package fake provides generic test data generation utilities for creating fake instances of any type.
Package fake provides generic test data generation utilities for creating fake instances of any type.
Package featureflags provides a feature flag evaluation interface for controlling feature availability per user, with implementations for LaunchDarkly and PostHog.
Package featureflags provides a feature flag evaluation interface for controlling feature availability per user, with implementations for LaunchDarkly and PostHog.
config
Package featureflagscfg selects and builds a featureflags.FeatureFlagManager from configuration: LaunchDarkly, PostHog, or the noop manager.
Package featureflagscfg selects and builds a featureflags.FeatureFlagManager from configuration: LaunchDarkly, PostHog, or the noop manager.
internal/openfeatureflags
Package openfeatureflags is the flag evaluation both of this module's OpenFeature-backed providers do.
Package openfeatureflags is the flag evaluation both of this module's OpenFeature-backed providers do.
launchdarkly
Package launchdarkly evaluates feature flags against LaunchDarkly, by way of OpenFeature.
Package launchdarkly evaluates feature flags against LaunchDarkly, by way of OpenFeature.
mock
Package featureflagsmock provides mock implementations of the featureflags package's interfaces.
Package featureflagsmock provides mock implementations of the featureflags package's interfaces.
noop
Package noop is the featureflags.FeatureFlagManager for a process with no flag system: each typed getter returns the default value it was handed, and CanUseFeature returns false.
Package noop is the featureflags.FeatureFlagManager for a process with no flag system: each typed getter returns the default value it was handed, and CanUseFeature returns false.
posthog
Package posthog evaluates feature flags against PostHog, by way of OpenFeature.
Package posthog evaluates feature flags against PostHog, by way of OpenFeature.
Package files provides ergonomic helpers for reading text files: iterating line by line or in fixed-size chunks, streaming chunks asynchronously off large files, slicing a window of lines, and decoding a structured file into a typed value via the encoding package.
Package files provides ergonomic helpers for reading text files: iterating line by line or in fixed-size chunks, streaming chunks asynchronously off large files, slicing a window of lines, and decoding a structured file into a typed value via the encoding package.
Package filtering is the shared vocabulary for list queries: which slice of a collection a caller asked for, and which slice they got.
Package filtering is the shared vocabulary for list queries: which slice of a collection a caller asked for, and which slice they got.
Package healthcheck provides health check monitoring for service components with status tracking and aggregation via a registry pattern.
Package healthcheck provides health check monitoring for service components with status tracking and aggregation via a registry pattern.
Package httpclient constructs HTTP clients with optional OpenTelemetry tracing instrumentation, resilience middleware, and response caching.
Package httpclient constructs HTTP clients with optional OpenTelemetry tracing instrumentation, resilience middleware, and response caching.
Package idempotency runs work at most once per client-supplied key.
Package idempotency runs work at most once per client-supplied key.
config
Package idempotencycfg assembles an idempotency.Manager from environment configuration.
Package idempotencycfg assembles an idempotency.Manager from environment configuration.
grpc
Package grpc adapts idempotency to gRPC, on both sides of the wire.
Package grpc adapts idempotency to gRPC, on both sides of the wire.
http
Package http adapts idempotency to HTTP, on both sides of the wire.
Package http adapts idempotency to HTTP, on both sides of the wire.
Package identifiers is a handy place to request a new string identifier from.
Package identifiers is a handy place to request a new string identifier from.
internal
cbormode
Package cbormode holds the one CBOR dialect this module speaks, so that the encoding package and the cache codec cannot drift into two incompatible spellings of the same format.
Package cbormode holds the one CBOR dialect this module speaks, so that the encoding package and the cache codec cannot drift into two incompatible spellings of the same format.
cfgnorm
Package cfgnorm holds the normalization a config performs on itself before its own validation runs.
Package cfgnorm holds the normalization a config performs on itself before its own validation runs.
cmd/benchtable command
Command benchtable turns raw `go test -bench` output into a markdown reference table.
Command benchtable turns raw `go test -bench` output into a markdown reference table.
injection
Package injection holds the samber/do helpers shared by this module's do.Provide registrations.
Package injection holds the samber/do helpers shared by this module's do.Provide registrations.
pgretry
Package pgretry re-runs a Postgres write that failed for one of the two reasons Postgres resolves by asking the caller to run it again.
Package pgretry re-runs a Postgres write that failed for one of the two reasons Postgres resolves by asking the caller to run it again.
plainname
Package plainname validates plain names: the ones an operator writes into config — a plan name, a meter name — that then travel into cache keys, idempotency keys, metric attribute values, and permission strings.
Package plainname validates plain names: the ones an operator writes into config — a plan name, a meter name — that then travel into cache keys, idempotency keys, metric attribute values, and permission strings.
redisclient
Package redisclient builds the go-redis client every Redis-backed package in this module talks through.
Package redisclient builds the go-redis client every Redis-backed package in this module talks through.
sqlguard
Package sqlguard runs the guarded write four durable-state packages in this module are built on, and says what it means when the guard matches nothing.
Package sqlguard runs the guarded write four durable-state packages in this module are built on, and says what it means when the guard matches nothing.
Package jobs supplies the lifecycle around background work: a bounded pool of workers consuming a queue, and a scheduler that runs periodic work once across a fleet.
Package jobs supplies the lifecycle around background work: a bounded pool of workers consuming a queue, and a scheduler that runs periodic work once across a fleet.
config
Package jobscfg assembles the jobs package from environment configuration: a Pool bound to a messagequeue consumer, and a Scheduler holding its periodic executions under a distributed lock.
Package jobscfg assembles the jobs package from environment configuration: a Pool bound to a messagequeue consumer, and a Scheduler holding its periodic executions under a distributed lock.
Package links mints URLs that prove their bearer was sent them, once, until they expire.
Package links mints URLs that prove their bearer was sent them, once, until they expire.
config
Package linkscfg assembles a links.Minter from environment configuration.
Package linkscfg assembles a links.Minter from environment configuration.
llm
Package llm is the platform's interface to language models: content blocks, tool calling, streaming, structured output, and token accounting, over Anthropic and OpenAI.
Package llm is the platform's interface to language models: content blocks, tool calling, streaming, structured output, and token accounting, over Anthropic and OpenAI.
anthropic
Package anthropic is the Anthropic-backed llm.Provider.
Package anthropic is the Anthropic-backed llm.Provider.
config
Package llmcfg selects and builds an llm.Provider from configuration: OpenAI, Anthropic, or the noop provider.
Package llmcfg selects and builds an llm.Provider from configuration: OpenAI, Anthropic, or the noop provider.
internal/bridge
Package bridge translates between the platform's llm types and any-llm-go's.
Package bridge translates between the platform's llm types and any-llm-go's.
mock
Package llmmock provides mock implementations of the llm package's interfaces.
Package llmmock provides mock implementations of the llm package's interfaces.
noop
Package noop is the llm.Provider that spends nothing: Completion returns an empty response that stopped at llm.StopReasonEndTurn, and Stream returns a stream carrying only llm.EventDone.
Package noop is the llm.Provider that spends nothing: Completion returns an empty response that stopped at llm.StopReasonEndTurn, and Stream returns a stream carrying only llm.EventDone.
openai
Package openai is the OpenAI-backed llm.Provider.
Package openai is the OpenAI-backed llm.Provider.
Package messagequeue provides message queue publisher and consumer interfaces with implementations for Google Pub/Sub, Redis, and Amazon SQS.
Package messagequeue provides message queue publisher and consumer interfaces with implementations for Google Pub/Sub, Redis, and Amazon SQS.
config
Package messagequeuecfg selects and builds messagequeue publisher and consumer providers from configuration, over Redis, SQS, GCP Pub/Sub, Kafka, or noop.
Package messagequeuecfg selects and builds messagequeue publisher and consumer providers from configuration, over Redis, SQS, GCP Pub/Sub, Kafka, or noop.
internal/consumererr
Package consumererr holds the send every messagequeue Consumer uses to report a handler or broker failure on the caller's error channel.
Package consumererr holds the send every messagequeue Consumer uses to report a handler or broker failure on the caller's error channel.
internal/mqmetrics
Package mqmetrics holds the instruments every messagequeue broker records, so that the four brokers agree on what each number means.
Package mqmetrics holds the instruments every messagequeue broker records, so that the four brokers agree on what each number means.
internal/receivewait
Package receivewait paces a consumer's receive loop after a failed receive.
Package receivewait paces a consumer's receive loop after a failed receive.
kafka
Package kafka is a messagequeue publisher and consumer over Apache Kafka.
Package kafka is a messagequeue publisher and consumer over Apache Kafka.
mock
Package messagequeuemock provides moq-generated mocks for the messagequeue package's Publisher, PublisherProvider, Consumer, and ConsumerProvider interfaces.
Package messagequeuemock provides moq-generated mocks for the messagequeue package's Publisher, PublisherProvider, Consumer, and ConsumerProvider interfaces.
noop
Package noop is the messagequeue publisher and consumer pair for a service with no broker.
Package noop is the messagequeue publisher and consumer pair for a service with no broker.
pubsub
Package pubsub is a messagequeue publisher and consumer over Google Cloud Pub/Sub.
Package pubsub is a messagequeue publisher and consumer over Google Cloud Pub/Sub.
redis
Package redis is a messagequeue publisher and consumer over Redis pub/sub.
Package redis is a messagequeue publisher and consumer over Redis pub/sub.
sqs
Package sqs is a messagequeue publisher and consumer over Amazon SQS.
Package sqs is a messagequeue publisher and consumer over Amazon SQS.
Package metering counts what customers consume and enforces what they are allowed to, durably enough to invoice from.
Package metering counts what customers consume and enforces what they are allowed to, durably enough to invoice from.
config
Package meteringcfg assembles the usage metering machinery from environment configuration: the Store every part shares, the Recorder usage arrives through, the Enforcer quotas are checked against, and the Flusher that posts to the billing provider.
Package meteringcfg assembles the usage metering machinery from environment configuration: the Store every part shares, the Recorder usage arrives through, the Enforcer quotas are checked against, and the Flusher that posts to the billing provider.
migrations
Package migrations supplies the usage metering tables' DDL, rendered for a dialect and table prefix.
Package migrations supplies the usage metering tables' DDL, rendered for a dialect and table prefix.
mock
Package meteringmock provides moq-generated mock implementations of interfaces in the metering package.
Package meteringmock provides moq-generated mock implementations of interfaces in the metering package.
notifications
async
Package async provides a channel-based async event delivery interface with implementations for WebSocket, SSE, Pusher, and Ably.
Package async provides a channel-based async event delivery interface with implementations for WebSocket, SSE, Pusher, and Ably.
async/ably
Package ably is an Ably-backed AsyncNotifier.
Package ably is an Ably-backed AsyncNotifier.
async/config
Package asynccfg selects and builds an async.AsyncNotifier from configuration: Pusher, Ably, WebSocket, SSE, or noop.
Package asynccfg selects and builds an async.AsyncNotifier from configuration: Pusher, Ably, WebSocket, SSE, or noop.
async/noop
Package noop is the async.AsyncNotifier that publishes to nobody.
Package noop is the async.AsyncNotifier that publishes to nobody.
async/pusher
Package pusher is a Pusher-backed AsyncNotifier.
Package pusher is a Pusher-backed AsyncNotifier.
async/sse
Package sse is an SSE-backed AsyncNotifier that holds its client connections in process memory.
Package sse is an SSE-backed AsyncNotifier that holds its client connections in process memory.
async/websocket
Package websocket is a WebSocket-backed AsyncNotifier that holds its client connections in process memory.
Package websocket is a WebSocket-backed AsyncNotifier that holds its client connections in process memory.
mobile
Package mobile provides a push notification sending interface with implementations for APNs and FCM.
Package mobile provides a push notification sending interface with implementations for APNs and FCM.
mobile/apns
Package apns sends push notifications to iOS devices through Apple's APNs.
Package apns sends push notifications to iOS devices through Apple's APNs.
mobile/config
Package mobilecfg selects and builds a mobile.PushSender from configuration: APNs for iOS, FCM for Android, apns_fcm for both, or noop.
Package mobilecfg selects and builds a mobile.PushSender from configuration: APNs for iOS, FCM for Android, apns_fcm for both, or noop.
mobile/fcm
Package fcm sends push notifications to Android devices through Firebase Cloud Messaging.
Package fcm sends push notifications to Android devices through Firebase Cloud Messaging.
mobile/noop
Package noop is the mobile.PushNotificationSender for a deployment with no APNs or FCM credentials.
Package noop is the mobile.PushNotificationSender for a deployment with no APNs or FCM credentials.
Package numbers provides numeric types, utilities, and range abstractions for rounding, scaling, and yield adjustment calculations.
Package numbers provides numeric types, utilities, and range abstractions for rounding, scaling, and yield adjustment calculations.
Package observability provides unified configuration and initialization for the four observability pillars: logging, metrics, tracing, and profiling.
Package observability provides unified configuration and initialization for the four observability pillars: logging, metrics, tracing, and profiling.
keys
Package keys is the module's attribute-name vocabulary: the string constants every package uses when it puts a value on a span or a log line.
Package keys is the module's attribute-name vocabulary: the string constants every package uses when it puts a value on a span or a log line.
logging
Package logging is the Logger seam every package in this module writes through, and the noop that stands in when a caller supplies none.
Package logging is the Logger seam every package in this module writes through, and the noop that stands in when a caller supplies none.
logging/config
Package loggingcfg selects and builds a logging.Logger from configuration: zerolog, zap, slog, the OTel-exporting slog, or none at all.
Package loggingcfg selects and builds a logging.Logger from configuration: zerolog, zap, slog, the OTel-exporting slog, or none at all.
logging/noop
Package noop is the logging.Logger that writes nowhere.
Package noop is the logging.Logger that writes nowhere.
logging/otelgrpc
Package otelgrpc implements logging.Logger over log/slog, fanning every record out to both stdout and an OTLP collector reached over gRPC.
Package otelgrpc implements logging.Logger over log/slog, fanning every record out to both stdout and an OTLP collector reached over gRPC.
logging/slog
Package slog implements logging.Logger over the standard library's log/slog, emitting JSON to stdout.
Package slog implements logging.Logger over the standard library's log/slog, emitting JSON to stdout.
logging/zap
Package zap implements logging.Logger over uber-go/zap.
Package zap implements logging.Logger over uber-go/zap.
logging/zerolog
Package zerolog implements logging.Logger over rs/zerolog.
Package zerolog implements logging.Logger over rs/zerolog.
metrics
Package metrics provides a metrics-tracking implementation for the service.
Package metrics provides a metrics-tracking implementation for the service.
metrics/config
Package metricscfg selects and builds a metrics.Provider from configuration: the OTel gRPC exporter, or no metrics at all.
Package metricscfg selects and builds a metrics.Provider from configuration: the OTel gRPC exporter, or no metrics at all.
metrics/metricstest
Package metricstest provides metric instruments for tests.
Package metricstest provides metric instruments for tests.
metrics/mock
Package metricsmock provides moq-generated mocks for the metrics package.
Package metricsmock provides moq-generated mocks for the metrics package.
metrics/noop
Package noop is the metrics.Provider that exports nothing.
Package noop is the metrics.Provider that exports nothing.
metrics/otelgrpc
Package otelgrpc implements metrics.Provider against an OTLP collector reached over gRPC.
Package otelgrpc implements metrics.Provider against an OTLP collector reached over gRPC.
profiling
Package profiling is the seam for continuous profiling: the fourth observability pillar, and the one that is not a dependency of anything.
Package profiling is the seam for continuous profiling: the fourth observability pillar, and the one that is not a dependency of anything.
profiling/config
Package profilingcfg selects and builds a profiling.Provider from configuration: Grafana Pyroscope, the Go-native pprof HTTP server, or no profiling at all.
Package profilingcfg selects and builds a profiling.Provider from configuration: Grafana Pyroscope, the Go-native pprof HTTP server, or no profiling at all.
profiling/noop
Package noop is the profiling.Provider for a deployment that ships no profiles.
Package noop is the profiling.Provider for a deployment that ships no profiles.
profiling/pprof
Package pprof implements profiling.Provider by serving net/http/pprof from a dedicated HTTP server.
Package pprof implements profiling.Provider by serving net/http/pprof from a dedicated HTTP server.
profiling/pyroscope
Package pyroscope implements profiling.Provider by pushing profiles continuously to a Pyroscope server.
Package pyroscope implements profiling.Provider by pushing profiles continuously to a Pyroscope server.
tracing
Package tracing provides distributed tracing utilities.
Package tracing provides distributed tracing utilities.
tracing/cloudtrace
Package cloudtrace provides common functions for attaching values to trace spans
Package cloudtrace provides common functions for attaching values to trace spans
tracing/config
Package tracingcfg selects and builds a tracing.Provider from configuration: the OTel gRPC exporter, GCP Cloud Trace, or no tracing at all.
Package tracingcfg selects and builds a tracing.Provider from configuration: the OTel gRPC exporter, GCP Cloud Trace, or no tracing at all.
tracing/noop
Package noop is the tracing.Provider that records no spans, and the detail worth knowing about it is that it still propagates.
Package noop is the tracing.Provider that records no spans, and the detail worth knowing about it is that it still propagates.
tracing/oteltrace
Package oteltrace provides common functions for attaching values to trace spans
Package oteltrace provides common functions for attaching values to trace spans
utils
Package o11yutils offers observability utility functions.
Package o11yutils offers observability utility functions.
Package operations runs work that outlives the request that asked for it, and gives the client something to watch while it does.
Package operations runs work that outlives the request that asked for it, and gives the client something to watch while it does.
config
Package operationscfg assembles the long-running-operations tier — the store, the service, the worker that runs operations, and the watcher that streams them — from environment configuration.
Package operationscfg assembles the long-running-operations tier — the store, the service, the worker that runs operations, and the watcher that streams them — from environment configuration.
http
Package http mounts the operations read surface on a routing.Router.
Package http mounts the operations read surface on a routing.Router.
migrations
Package migrations supplies the operations table's DDL, rendered for a table prefix.
Package migrations supplies the operations table's DDL, rendered for a table prefix.
mock
Package operationsmock provides moq-generated mock implementations of interfaces in the operations package.
Package operationsmock provides moq-generated mock implementations of interfaces in the operations package.
Package outbox makes "write a row and publish an event" atomic.
Package outbox makes "write a row and publish an event" atomic.
config
Package outboxcfg assembles the outbox from environment configuration: a Writer for the transactional side and a Relay, with its publisher provider, for the delivery side.
Package outboxcfg assembles the outbox from environment configuration: a Writer for the transactional side and a Relay, with its publisher provider, for the delivery side.
migrations
Package migrations supplies the outbox table's DDL, rendered for a dialect and table prefix.
Package migrations supplies the outbox table's DDL, rendered for a dialect and table prefix.
Package panicking provides an abstraction over panic behavior, enabling testing and mocking of panic-inducing code paths.
Package panicking provides an abstraction over panic behavior, enabling testing and mocking of panic-inducing code paths.
mock
Package panickingmock provides moq-generated mock implementations of the panicking package's interfaces.
Package panickingmock provides moq-generated mock implementations of the panicking package's interfaces.
Package pointer provides generic utility functions for creating pointers to values and dereferencing pointer values and slices.
Package pointer provides generic utility functions for creating pointers to values and dereferencing pointer values and slices.
Package qrcodes provides QR code generation for TOTP two-factor authentication setup.
Package qrcodes provides QR code generation for TOTP two-factor authentication setup.
noop
Package noop is the qrcodes.Builder that draws nothing.
Package noop is the qrcodes.Builder that draws nothing.
Package random provides cryptographically secure random string generation in hex, base32, and base64 encodings.
Package random provides cryptographically secure random string generation in hex, base32, and base64 encodings.
mock
Package randommock provides moq-generated mock implementations of the random package's interfaces.
Package randommock provides moq-generated mock implementations of the random package's interfaces.
noop
Package noop is the random.Generator that has nothing to draw from: every method returns random.ErrNoRandomness and no value.
Package noop is the random.Generator that has nothing to draw from: every method returns random.ErrNoRandomness and no value.
Package ratelimiting provides a per-key rate limiter interface using the token bucket algorithm.
Package ratelimiting provides a per-key rate limiter interface using the token bucket algorithm.
config
Package ratelimitingcfg selects and builds a rate limiter from configuration: the in-process memory limiter, the Redis-backed one, or noop.
Package ratelimitingcfg selects and builds a rate limiter from configuration: the in-process memory limiter, the Redis-backed one, or noop.
grpc
Package grpc adapts ratelimiting to inbound gRPC.
Package grpc adapts ratelimiting to inbound gRPC.
http
Package http adapts ratelimiting to inbound HTTP.
Package http adapts ratelimiting to inbound HTTP.
noop
Package noop is the ratelimiting.RateLimiter that never limits: Allow returns true for every key, and there is no counter, window, or store behind it to consult.
Package noop is the ratelimiting.RateLimiter that never limits: Allow returns true for every key, and there is no counter, window, or store behind it to consult.
redis
Package redis implements ratelimiting.RateLimiter as a sliding window kept in a Redis sorted set.
Package redis implements ratelimiting.RateLimiter as a sliding window kept in a Redis sorted set.
Package reflection provides utilities for struct field inspection, tag extraction, and dynamic method introspection.
Package reflection provides utilities for struct field inspection, tag extraction, and dynamic method introspection.
ast
Package ast reads Go source as text: the helpers a code generator or an analysis tool needs to walk a repository's files and learn what is declared in them.
Package ast reads Go source as text: the helpers a code generator or an analysis tool needs to walk a repository's files and learn what is declared in them.
Package retention deletes data on a clock, from policies given as data.
Package retention deletes data on a clock, from policies given as data.
config
Package retentioncfg assembles a retention Sweeper from environment configuration.
Package retentioncfg assembles a retention Sweeper from environment configuration.
Package retry provides retry policies for resilient operation execution.
Package retry provides retry policies for resilient operation execution.
config
Package retrycfg builds a retry.Policy from configuration — exponential backoff, which an unset provider selects, or noop, which has to be named.
Package retrycfg builds a retry.Policy from configuration — exponential backoff, which an unset provider selects, or noop, which has to be named.
noop
Package noop is the retry.Policy that does not retry: Execute calls the operation once and returns whatever the operation returned.
Package noop is the retry.Policy that does not retry: Execute calls the operation once and returns whatever the operation returned.
Package routing provides a declarative, type-safe HTTP router that generates an OpenAPI 3 specification as routes are registered.
Package routing provides a declarative, type-safe HTTP router that generates an OpenAPI 3 specification as routes are registered.
backends/chi
Package chi provides a routing.Backend built on go-chi/chi.
Package chi provides a routing.Backend built on go-chi/chi.
backends/gin
Package gin provides a routing.Backend built on gin-gonic/gin.
Package gin provides a routing.Backend built on gin-gonic/gin.
backends/httprouter
Package httprouter provides a routing.Backend built on julienschmidt/httprouter, a fast radix-tree router.
Package httprouter provides a routing.Backend built on julienschmidt/httprouter, a fast radix-tree router.
backends/internal/conformance
Package conformance holds the tests that pin every routing.Backend to one answer, rather than to whatever its underlying library happens to do.
Package conformance holds the tests that pin every routing.Backend to one answer, rather than to whatever its underlying library happens to do.
backends/internal/httpmw
Package httpmw holds the net/http middleware stack shared by every routing backend.
Package httpmw holds the net/http middleware stack shared by every routing backend.
backends/internal/pathvalues
Package pathvalues holds the one decode step every routing backend that matches on the escaped path owes its callers.
Package pathvalues holds the one decode step every routing backend that matches on the escaped path owes its callers.
backends/stdlib
Package stdlib provides a routing.Backend built on the standard library's net/http.ServeMux.
Package stdlib provides a routing.Backend built on the standard library's net/http.ServeMux.
config
Package routingcfg selects and builds a routing backend from configuration: chi, net/http's ServeMux, httprouter, or gin.
Package routingcfg selects and builds a routing backend from configuration: chi, net/http's ServeMux, httprouter, or gin.
mock
Package routingmock provides mock implementations of the routing package's interfaces (currently the Backend seam), for testing routers without a real mux library.
Package routingmock provides mock implementations of the routing package's interfaces (currently the Backend seam), for testing routers without a real mux library.
Package saga runs a linear sequence of steps durably, and unwinds it when a step fails.
Package saga runs a linear sequence of steps durably, and unwinds it when a step fails.
config
Package sagacfg assembles the saga machinery from environment configuration: the Store the runner and the worker share, and the Worker that advances instances.
Package sagacfg assembles the saga machinery from environment configuration: the Store the runner and the worker share, and the Worker that advances instances.
migrations
Package migrations supplies the saga instance table's DDL, rendered for a dialect and table prefix.
Package migrations supplies the saga instance table's DDL, rendered for a dialect and table prefix.
mock
Package sagamock provides moq-generated mock implementations of interfaces in the saga package.
Package sagamock provides moq-generated mock implementations of interfaces in the saga package.
search
pagination
Package searchpagination adapts a text index's cursor pagination to the filtering.QueryFilter pagination an API hands back to clients, and runs the index-then-hydrate loop that a text search always is.
Package searchpagination adapts a text index's cursor pagination to the filtering.QueryFilter pagination an API hands back to clients, and runs the index-then-hydrate loop that a text search always is.
sync
Package searchsync keeps a search index in step with the database it is derived from.
Package searchsync keeps a search index in step with the database it is derived from.
sync/source
Package syncsource adapts a repository to the two read seams searchsync defines: searchsync.Fetcher, which the change feed reads one document per event through, and searchsync.Scanner, which a reindex walks the whole source with.
Package syncsource adapts a repository to the two read seams searchsync defines: searchsync.Fetcher, which the change feed reads one document per event through, and searchsync.Scanner, which a reindex walks the whole source with.
text
Package textsearch defines an interface for a search index management structure
Package textsearch defines an interface for a search index management structure
text/algolia
Package algolia provides an interface-compatible wrapper around the algolia indexer
Package algolia provides an interface-compatible wrapper around the algolia indexer
text/config
Package textsearchcfg selects and builds a text search index from configuration: Elasticsearch, Algolia, or noop.
Package textsearchcfg selects and builds a text search index from configuration: Elasticsearch, Algolia, or noop.
text/elasticsearch
Package elasticsearch provides an interface-compatible wrapper around the elasticsearch indexer
Package elasticsearch provides an interface-compatible wrapper around the elasticsearch indexer
text/mock
Package textsearchmock provides moq-generated mocks for the search/text package.
Package textsearchmock provides moq-generated mocks for the search/text package.
text/noop
Package noop is the textsearch.Index for a service with no search cluster: Index, Delete, and Wipe all succeed and keep nothing, and Search returns zero hits.
Package noop is the textsearch.Index for a service with no search cluster: Index, Delete, and Wipe all succeed and keep nothing, and Search returns zero hits.
vector
Package vectorsearch provides a generic interface for vector (nearest-neighbor) search backends, parallel to the textsearch package under search/text.
Package vectorsearch provides a generic interface for vector (nearest-neighbor) search backends, parallel to the textsearch package under search/text.
vector/config
Package vectorsearchcfg selects and builds a vector search index from configuration: pgvector, Qdrant, or noop.
Package vectorsearchcfg selects and builds a vector search index from configuration: pgvector, Qdrant, or noop.
vector/mock
Package vectorsearchmock provides moq-generated mocks for the search/vector package.
Package vectorsearchmock provides moq-generated mocks for the search/vector package.
vector/noop
Package noop is the vectorsearch.Index for a deployment running no vector store: Upsert, Delete, and Wipe report success without keeping anything, and Query returns an empty result slice.
Package noop is the vectorsearch.Index for a deployment running no vector store: Upsert, Delete, and Wipe report success without keeping anything, and Query returns an empty result slice.
vector/pgvector
Package pgvector implements vectorsearch.Index against a PostgreSQL database running the pgvector extension.
Package pgvector implements vectorsearch.Index against a PostgreSQL database running the pgvector extension.
vector/qdrant
Package qdrant implements vectorsearch.Index against a Qdrant vector database over its REST API.
Package qdrant implements vectorsearch.Index against a Qdrant vector database over its REST API.
Package secrets provides a secret retrieval interface with implementations for environment variables, GCP Secret Manager, AWS SSM Parameter Store, and Kubernetes secrets.
Package secrets provides a secret retrieval interface with implementations for environment variables, GCP Secret Manager, AWS SSM Parameter Store, and Kubernetes secrets.
config
Package secretscfg selects and builds a secrets.SecretSource from configuration: environment variables, GCP Secret Manager, AWS SSM Parameter Store, Kubernetes secrets, or noop.
Package secretscfg selects and builds a secrets.SecretSource from configuration: environment variables, GCP Secret Manager, AWS SSM Parameter Store, Kubernetes secrets, or noop.
env
Package env reads secrets from this process's environment.
Package env reads secrets from this process's environment.
gcp
Package gcp reads secrets from GCP Secret Manager.
Package gcp reads secrets from GCP Secret Manager.
kubernetes
Package kubernetes sources secrets from the Kubernetes Secrets API.
Package kubernetes sources secrets from the Kubernetes Secrets API.
noop
Package noop is the secrets.SecretSource that holds no secrets, and how it says so is the thing to know: GetSecret returns secrets.ErrSecretNotFound for every name it is ever asked.
Package noop is the secrets.SecretSource that holds no secrets, and how it says so is the thing to know: GetSecret returns secrets.ErrSecretNotFound for every name it is ever asked.
ssm
Package ssm reads secrets from AWS SSM Parameter Store.
Package ssm reads secrets from AWS SSM Parameter Store.
server
grpc
Package grpc builds the gRPC server this module's services are served from: the listener, the interceptor chain, TLS, health, and a shutdown that drains before it flushes.
Package grpc builds the gRPC server this module's services are served from: the listener, the interceptor chain, TLS, health, and a shutdown that drains before it flushes.
http
Package http provides an HTTP server comprised of multiple HTTP services
Package http provides an HTTP server comprised of multiple HTTP services
Package service is platform-go's composition root: one config struct describing a whole service, and one walk that registers everything it names with a samber/do injector.
Package service is platform-go's composition root: one config struct describing a whole service, and one walk that registers everything it names with a samber/do injector.
Package sessions keeps session state on the server and gives the client only an identifier.
Package sessions keeps session state on the server and gives the client only an identifier.
cache
Package cache stores session records in a cache.Cache.
Package cache stores session records in a cache.Cache.
config
Package sessionscfg assembles a session store, and optionally a cookie-bound manager, from environment configuration.
Package sessionscfg assembles a session store, and optionally a cookie-bound manager, from environment configuration.
database
Package database stores session records in a SQL table.
Package database stores session records in a SQL table.
database/migrations
Package migrations supplies the session table's DDL, rendered for a dialect and table prefix.
Package migrations supplies the session table's DDL, rendered for a dialect and table prefix.
http
Package http binds a sessions.Store to a signed cookie and to net/http.
Package http binds a sessions.Store to a signed cookie and to net/http.
mock
Package sessionsmock provides moq-generated mock implementations of interfaces in the sessions package.
Package sessionsmock provides moq-generated mock implementations of interfaces in the sessions package.
Package testutils contains common functions for integration/load tests
Package testutils contains common functions for integration/load tests
containers
Package containers provides shared helpers for starting testcontainers with uniform retry behavior.
Package containers provides shared helpers for starting testcontainers with uniform retry behavior.
containers/mysqltest
Package mysqltest provides the MySQL testcontainer setup that every MySQL-backed suite in this repo would otherwise hand-roll: start the container with the shared retry policy and wait strategy, open a go-sql-driver pool against it, ping it, and tear all of it down afterwards.
Package mysqltest provides the MySQL testcontainer setup that every MySQL-backed suite in this repo would otherwise hand-roll: start the container with the shared retry policy and wait strategy, open a go-sql-driver pool against it, ping it, and tear all of it down afterwards.
containers/pgtest
Package pgtest provides the postgres testcontainer setup that every postgres-backed suite in this repo would otherwise hand-roll: start the container with the shared retry policy and wait strategy, open a pgx-backed *sql.DB against it, ping it, and tear all of it down afterwards.
Package pgtest provides the postgres testcontainer setup that every postgres-backed suite in this repo would otherwise hand-roll: start the container with the shared retry policy and wait strategy, open a pgx-backed *sql.DB against it, ping it, and tear all of it down afterwards.
containers/redistest
Package redistest provides a single source of truth for the redis testcontainer setup that the redis-backed test suites in this repo all duplicate.
Package redistest provides a single source of truth for the redis testcontainer setup that the redis-backed test suites in this repo all duplicate.
Package timers is durable one-shot scheduling over Postgres: run this once at instant T, exactly once across the fleet, surviving restarts.
Package timers is durable one-shot scheduling over Postgres: run this once at instant T, exactly once across the fleet, surviving restarts.
config
Package timerscfg assembles a timer set, and optionally the worker that fires it, from environment configuration.
Package timerscfg assembles a timer set, and optionally the worker that fires it, from environment configuration.
migrations
Package migrations supplies the timer table's DDL, rendered for a table prefix.
Package migrations supplies the timer table's DDL, rendered for a table prefix.
Package uploads provides an object storage abstraction for saving and reading files, with implementations backed by S3, GCS, Cloudflare R2, Backblaze B2, the local filesystem, and an in-memory provider (see the objectstorage subpackage).
Package uploads provides an object storage abstraction for saving and reading files, with implementations backed by S3, GCS, Cloudflare R2, Backblaze B2, the local filesystem, and an in-memory provider (see the objectstorage subpackage).
config
Package uploadscfg carries the uploads configuration and hands its object storage half to a do injector.
Package uploadscfg carries the uploads configuration and hands its object storage half to a do injector.
images
Package images provides small, pure helpers for validating, encoding, and thumbnailing images.
Package images provides small, pure helpers for validating, encoding, and thumbnailing images.
mock
Package uploadsmock provides moq-generated mock implementations of the uploads package interfaces (UploadManager and the optional capability interfaces) for use in tests.
Package uploadsmock provides moq-generated mock implementations of the uploads package interfaces (UploadManager and the optional capability interfaces) for use in tests.
noop
Package noop is the uploads.UploadManager that stores nothing, and it is the only implementation here that can still return an error.
Package noop is the uploads.UploadManager that stores nothing, and it is the only implementation here that can still return an error.
objectstorage
Package objectstorage is the uploads.UploadManager backed by gocloud.dev/blob.
Package objectstorage is the uploads.UploadManager backed by gocloud.dev/blob.
Package version manages build-time version and VCS metadata injection via linker flags.
Package version manages build-time version and VCS metadata injection via linker flags.
Package webhooks delivers outbound webhooks: signed, retried, ordered, and replayable.
Package webhooks delivers outbound webhooks: signed, retried, ordered, and replayable.
config
Package webhookscfg assembles the webhook machinery from environment configuration: the Store both halves share, the Dispatcher applications write through, and the Worker that delivers.
Package webhookscfg assembles the webhook machinery from environment configuration: the Store both halves share, the Dispatcher applications write through, and the Worker that delivers.
inbound
Package inbound receives webhooks: it verifies the provider's signature over the bytes as they arrived, publishes the delivery to a message queue, and acks.
Package inbound receives webhooks: it verifies the provider's signature over the bytes as they arrived, publishes the delivery to a message queue, and acks.
inbound/config
Package inboundcfg assembles an inbound webhook receiver from environment configuration: the Verifier for the provider's signing scheme, and the Receiver that mounts on a router and publishes what it verifies.
Package inboundcfg assembles an inbound webhook receiver from environment configuration: the Verifier for the provider's signing scheme, and the Receiver that mounts on a router and publishes what it verifies.
migrations
Package migrations supplies the webhook tables' DDL, rendered for a dialect and table prefix.
Package migrations supplies the webhook tables' DDL, rendered for a dialect and table prefix.
mock
Package webhooksmock provides moq-generated mock implementations of interfaces in the webhooks package.
Package webhooksmock provides moq-generated mock implementations of interfaces in the webhooks package.
Package workqueue is a leased work queue over Postgres: the SELECT … FOR UPDATE SKIP LOCKED claim/complete/expire pattern, generic over the key that names a unit of work.
Package workqueue is a leased work queue over Postgres: the SELECT … FOR UPDATE SKIP LOCKED claim/complete/expire pattern, generic over the key that names a unit of work.
config
Package workqueuecfg assembles a work queue from environment configuration.
Package workqueuecfg assembles a work queue from environment configuration.
migrations
Package migrations supplies the work queue table's DDL, rendered for a table prefix.
Package migrations supplies the work queue table's DDL, rendered for a table prefix.

Jump to

Keyboard shortcuts

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