psql

package
v0.0.0-...-edc38d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenConnectionPool

func OpenConnectionPool(conf Config, log logrus.Ext1FieldLogger) (*sqlx.DB, error)

func SetConfig

func SetConfig(v *viper.Viper)

SetConfig the env vars and defaults with viper

Types

type Config

type Config struct {
	DBHost           string `mapstructure:"dbhost"`
	DBPort           int    `mapstructure:"dbport"`
	DBUser           string `mapstructure:"dbuser"`
	DBPassword       string `mapstructure:"dbpassword"`
	DBName           string `mapstructure:"dbname"`
	MaxOpenConns     int    `mapstructure:"maxopenconns"`
	MaxIdleConns     int    `mapstructure:"maxidleconns"`
	MaxLifetimeConns int    `mapstructure:"maxlifetimeconns"`
}

Config is the configuration of the Postgresql database

func NewConfig

func NewConfig(v *viper.Viper) (out Config, _ error)

NewConfig gets the PSQLConfig from viper

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL