Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Database is the name of the database.
Database string `envconfig:"PG_DB"`
// Host is the host of the database.
Host string `envconfig:"PG_HOST"`
// Password is the password of the database.
Password string `envconfig:"PG_PASSWORD"`
// Port is the port of the database.
Port int `envconfig:"PG_PORT" default:"5432"`
// SslMode is the SSL mode of the database.
SslMode string `envconfig:"PG_SSL_MODE" default:"disable"`
// User is the user of the database.
User string `envconfig:"PG_USER"`
}
Config represents configuration for PostgreSQL connection.
func FromContext ¶
FromContext will return the Config carried in the provided Context.
It panics if config is not available on the current context.
Click to show internal directories.
Click to hide internal directories.