dbx

package
v0.0.0-...-774e91b Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustDB

func MustDB(dsn string, poolSize ...int) *sqlx.DB

Types

type Cfg

type Cfg struct {
	Host     string `json:"host"`     // IP
	Port     int    `json:"port"`     // 端口
	Username string `json:"username"` // 用户名
	Password string `json:"password"` // 密码
	Db       string `json:"db"`       // 数据库
	MaxOpen  int    `json:"max_open"` // 最大打开连接数
	MaxIdle  int    `json:"max_idle"` // 空闲状态下的最大连接数
}

func Load

func Load(cli *clientv3.Client, env string) *Cfg

func (*Cfg) DataSource

func (c *Cfg) DataSource() string

func (*Cfg) NewDB

func (c *Cfg) NewDB() *sqlx.DB

Jump to

Keyboard shortcuts

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