Documentation
¶
Overview ¶
Package postgres provides a typed Config for PostgreSQL connections that produces a DSN string consumable by core/sql.New.
Importing this package also registers the lib/pq driver via blank import, so consuming code does not need a separate driver import.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string
Port string
User string
Password string
Name string
// SSLMode follows libpq conventions: "disable", "require",
// "verify-ca", "verify-full". Defaults to "disable" when empty.
SSLMode string
}
Config describes a PostgreSQL connection. Plain fields, no struct tags — consumer apps map their viper keys to fields explicitly inside their own config.NewConfig().
Click to show internal directories.
Click to hide internal directories.