Documentation ¶
Overview ¶
Package cfg is for reading config from environment variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Postgres ¶
type Postgres struct { Host string // The host to connect to [DB_HOST]. User string // The user to sign in as [DB_USER]. Password string // The user's password [DB_PASSWD]. Name string // The name of the database to connect to [DB_NAME]. SSLMode string // Whether or not to use SSL [DB_SSLMODE]. ConnectTimeout int // Maximum wait for connection, in seconds [DB_CONN_TIMEOUT]. MaxIdle int // Maximum idle db connections [DB_MAX_IDLE_CONNS]. MaxOpen int // Connection pool size [DB_MAX_OPEN_CONNS]. }
func PostgresEnv ¶
PostgresEnv returns a Postgres with configuration from the environment variables. Returns an error for missing config or errors parsing int values.
func (*Postgres) Connection ¶
Click to show internal directories.
Click to hide internal directories.