Packages
The public Go API lives under pkg/; the pg-proxy binary lives under cmd/pg-proxy. The API may change between releases.
| Package | Role |
|---|---|
. (pgproxy) |
Process-wide Bootstrap / Dependencies (LogHandler, Metrics, MetricNamespace, Tracer) |
pkg/actions |
Portable frontend-message decision state machine |
pkg/auth |
Static SCRAM users and explicit database grants |
pkg/backend |
Within-cluster routing, connection checkout, and session-link construction |
pkg/config |
Portable database, routing, listener, user, and mirroring configuration |
pkg/classifier |
SQL read-routing classification and statement counting |
pkg/protocol |
Wire-protocol conversations (Exchange, cleartext) |
pkg/scram |
SCRAM-SHA-256 authentication |
pkg/server |
Startup resolution, read routing, session construction, and listener/inventory composition |
pkg/datadog |
Native Datadog tracing and setup for traces, DogStatsD metrics, and JSON logs |
pkg/otel |
OpenTelemetry trace, metric, and slog adapters |
pkg/query |
Post-auth message decisions and query tracing |
pkg/bindparams |
Bounded copies of Bind parameters, decoded into per-position trace tags |
pkg/prepared |
Prepared-statement name mapping for txn pooling |
pkg/sessionsql |
Allocation-free scan of SQL text for statements that may change session state, used by the dynamic and audit reset modes |
pkg/pool |
Direct, discovered, static cloud, and replica pool runtimes; instance health, selection, and pgx adapters |
pkg/pool/resizable |
A pgx pool wrapper that enforces a connection limit that can change at runtime, up to the configured MaxConns |
pkg/link |
Session↔Postgres link: expectations, prepared-on-conn, release |
pkg/limiter |
Portable global and per-service session caps |
pkg/listener |
TCP/TLS negotiation, startup, admission, and session lifecycle |
pkg/mirror |
Bounded asynchronous traffic-mirroring queue and worker |
pkg/session |
Client session protocol engine, routing, draining, and lifecycle |
pkg/topology |
Portable logical-database routing and runtime configuration |
pkg/warden |
Versioned configuration refresh, backend reconciliation, runtime inventory, and shutdown coordination |
