drivers

package
v0.0.0-...-1b09624 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundEngine = errors.New("not found sql engine")
)

Functions

func Close

func Close()

func InitMysql

func InitMysql(confs map[string]MySqlConfig) error

Types

type MySqlConfig

type MySqlConfig struct {
	DBName          string `toml:"db_name"`
	Host            string `toml:"host"`
	Port            int    `toml:"port"`
	User            string `toml:"user"`
	Passwd          string `toml:"passwd"`
	ConnTimeout     string `toml:"conn_timeout"`
	ReadTimeout     string `toml:"read_timeout"`
	WriteTimeout    string `toml:"write_timeout"`
	MaxConnNum      int    `toml:"max_conn_num"`
	MaxIdleConnNum  int    `toml:"max_idle_conn_num"`
	MaxConnLifeTime int    `toml:"max_conn_life_time"`
}

type MysqlEngine

type MysqlEngine struct {
	*xorm.Engine
	// contains filtered or unexported fields
}

func GetMysqlEngine

func GetMysqlEngine(db string) (*MysqlEngine, error)

func NewCustomMysqlEngine

func NewCustomMysqlEngine(ctx context.Context, host string, port int, user, password string, database string) (*MysqlEngine, error)

func (*MysqlEngine) Close

func (mysql *MysqlEngine) Close()

Jump to

Keyboard shortcuts

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