Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultSSLMode is verify-full DefaultSSLMode = "verify-full" // DefaultPort is the default post for Postgresql connections DefaultPort = 5432 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { User string `envconfig:"POSTGRESQL_USER"` Pw string `envconfig:"POSTGRESQL_PW"` Host string `envconfig:"POSTGRESQL_HOST_NAME"` Port int `envconfig:"POSTGRESQL_PORT"` DBName string `envconfig:"POSTGRESQL_DB_NAME"` SSLMode string `envconfig:"POSTGRESQL_SSL_MODE"` }
Config holds everything you need to connect and interact with a PostgreSQL DB.
func LoadConfigFromEnv ¶
func LoadConfigFromEnv() *Config
LoadConfigFromEnv will attempt to load a Postgresql object from environment variables. If not populated, nil is returned
Click to show internal directories.
Click to hide internal directories.