db

package
v0.0.0-...-35fa672 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDb = errors.New("no db")

Functions

func Add

func Add(name string, c Config) error

func GetDB

func GetDB(name string) (*sql.DB, error)

Types

type Config

type Config struct {
	Addr            string `toml:"addr" json:"addr"`
	User            string `toml:"user" json:"user"`
	Pwd             string `toml:"pwd" json:"pwd"`
	Db              string `toml:"db" json:"db"`
	Options         string `toml:"options" json:"options"`
	MaxOpenConns    int    `toml:"max_open_conns" json:"max_open_conns"`
	MaxIdleConns    int    `toml:"max_idle_conns" json:"max_idle_conns"`
	MaxConnLifeTime int    `toml:"max_conn_life_time" json:"max_conn_life_time"`
}

func (Config) Dsn

func (c Config) Dsn() string

Jump to

Keyboard shortcuts

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