Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ServerDbSaverWg sync.WaitGroup
Functions ¶
func Config ¶
Config retrieves the postgres DB connection url from environment variable named `BARK_DATABASE_URL`. It then parses the connection url and checks for empty and invalid urls, if found, it logs the error and connection is not made. If it passes the checks, the connection is established and function returns object of pgxpool config.
Types ¶
type BarkPostgresDb ¶
BarkPostgresDb wraps the *pgxpool.Pool in a custom struct to use it as a receiver for query functions
var BarkDb *BarkPostgresDb
func OpenDb ¶
func OpenDb(dbUrl string) (*BarkPostgresDb, error)
OpenDb : OpenDB returns a pointer to the `BarkPostgresDb` object.
func (*BarkPostgresDb) CloseDb ¶
func (d *BarkPostgresDb) CloseDb()
CloseDb closes the connection to the DB.
Click to show internal directories.
Click to hide internal directories.