MCPcopy Index your code
hub / github.com/dreamsofcode-io/zenstats / loadConfig

Function loadConfig

internal/database/database.go:39–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37}
38
39func loadConfig() (*pgxpool.Config, error) {
40 cfg, err := config.NewDatabase()
41 if err != nil {
42 return loadConfigFromURL()
43 }
44
45 return pgxpool.ParseConfig(fmt.Sprintf(
46 "user=%s password=%s host=%s port=%d dbname=%s sslmode=%s",
47 cfg.Username, cfg.Password, cfg.Host, cfg.Port, cfg.DBName, cfg.SSLMode,
48 ))
49}
50
51func dbURL() (string, error) {
52 cfg, err := config.NewDatabase()

Callers 1

ConnectFunction · 0.85

Calls 2

NewDatabaseFunction · 0.92
loadConfigFromURLFunction · 0.85

Tested by

no test coverage detected