Skip to main content

Foundation package catalogue

The source tree contains platform contracts and a broader set of foundation packages. When an equivalent platform package exists, new services should prefer it.

Identity, security, and trust

PackagesPurpose
auth, auth/jwt, auth/resolverJWT and identity resolution adapters
auth/authorization, auth/fgaAuthorization clients and OpenFGA integration
auth/appidApplication-credential integration
crypto/envelopeSigned and encrypted envelope primitives
mtlsMutual-TLS configuration and clients
transport/headersSigned downstream subject headers
trustTrust-list and certificate support

Use platform/security/identity for application-layer caller data and platform/http/middleware for the standard HTTP resolver.

Data and storage

PackagesPurpose
database/postgres/clientPostgreSQL client utilities
database/postgres/daoEstablished DAO helpers
database/postgres/migrateEmbedded schema migrations
database/postgres/queryQuery helpers
database/postgres/repositoryEstablished repository helpers
database/postgres/sqlcxsqlc support
database/postgres/transactionTransaction utilities
database/elasticsearch/clientElasticsearch client
database/elasticsearch/indexing, mapping, query, repositorySearch index and repository support
database/redisRedis client support
storage/s3, storage/stsS3 objects and short-lived credentials

Prefer platform/database/sql for new PostgreSQL access and platform/cache for cache semantics. Search, S3, and STS currently use their foundation packages.

Messaging and background work

PackagesPurpose
messaging/rabbitmqRabbitMQ client, publisher, and consumer support
messaging/outboxEstablished outbox support
schedulerRecurring jobs
notify/emailEmail templates and SMTP dispatch

Prefer platform/events and platform/events/amqp for new domain events. Use scheduler or email packages where no platform seam exists.

HTTP and contracts

PackagesPurpose
httpserverEstablished HTTP server lifecycle
middlewareHTTP middleware collection
openapiOpenAPI serving and validation
request, responseEstablished request and response types
validationInput validation
pagination, modelEstablished common models

Prefer platform/bootstrap, platform/http, platform/errors, and platform/paging in new services.

Operations and engineering

PackagesPurpose
loggingStructured logging configuration
metricsPrometheus metrics
observabilityTracing and telemetry helpers
healthEstablished health endpoints
resilienceRetry, circuit-breaker, and reliability helpers
auditingAudit event support
configEstablished configuration loader
dxtest, dxtest/containers, dxtest/fixturesTest helpers and disposable infrastructure
grpc/clientgRPC client support
errorsEstablished error package

Prefer the platform equivalent where listed in dx-common-go. Direct foundation use remains valid for capabilities without an equivalent.