sql

package
v0.0.0-...-94a1dca Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func NewDbConnection

func NewDbConnection(logger *zap.SugaredLogger) (*pg.DB, error)

Types

type Config

type Config struct {
	Addr                   string `env:"PG_ADDR" envDefault:"127.0.0.1"`
	Port                   string `env:"PG_PORT" envDefault:"5432"`
	User                   string `env:"PG_USER" envDefault:""`
	Password               string `env:"PG_PASSWORD" envDefault:"" secretData:"-"`
	Database               string `env:"PG_DATABASE" envDefault:"central_api"`
	ApplicationName        string `env:"APP" envDefault:"central_api"`
	LogQuery               bool   `env:"PG_LOG_QUERY" envDefault:"false"`
	LogAllQuery            bool   `env:"PG_LOG_ALL_QUERY" envDefault:"false"`
	QueryDurationThreshold int64  `env:"PG_QUERY_DUR_THRESHOLD" envDefault:"5000"`
}

func ParseConfig

func ParseConfig() (*Config, error)

Jump to

Keyboard shortcuts

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