db

package
v0.0.0-...-a03c5e1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const PingTimeout = 10 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DSN             string        `json:"dsn,omitempty"                koanf:"dsn"`
	Debug           bool          `json:"debug,omitempty"              koanf:"debug"`
	MaxIdelConns    int           `json:"max_idel_conns,omitempty"     koanf:"max_idel_conns"`
	MaxOpenConns    int           `json:"max_open_conns,omitempty"     koanf:"max_open_conns"`
	ConnMaxIdleTime time.Duration `json:"conn_max_idle_time,omitempty" koanf:"conn_max_idle_time"`
	ConnMaxLifetime time.Duration `json:"conn_max_lifetime,omitempty"  koanf:"conn_max_lifetime"`
}

type DB

type DB struct {
	DB  *gorm.DB
	SQL *sql.DB
}

func Provide

func Provide(cfg Config, logger *zap.Logger) (*DB, error)

Jump to

Keyboard shortcuts

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