Documentation ¶
Index ¶
- func Transaction(ctx context.Context, db *sql.DB, opt *sql.TxOptions, fn func(tx *sql.Tx) error) error
- type MySqls
- type MysqlConf
- type MysqlConfExts
- type RedisConf
- type RedisConfExts
- type Redises
- func (r *Redises) Client(key string) *redis.Client
- func (r *Redises) Conn(key string) redigo.Conn
- func (r *Redises) Init(confs []RedisConf, useClient bool) error
- func (r *Redises) Ping(key string) (string, error)
- func (r *Redises) PubConn(key string) redigo.Conn
- func (r *Redises) SubConn(key string) redigo.PubSubConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MysqlConf ¶
type MysqlConf struct { Name string `yaml:"name"` Type string `yaml:"type"` Dsn string `yaml:"dsn"` Exts MysqlConfExts `yaml:"exts"` }
MysqlConf ...
type MysqlConfExts ¶
type MysqlConfExts struct { MaxIdle int `yaml:"maxIdle"` MaxOpen int `yaml:"maxOpen"` MaxPoolSize int `yaml:"maxPoolSize"` MaxConnLife string `yaml:"maxConnLifeTime"` }
MysqlConfExts ...
type RedisConf ¶
type RedisConf struct { Name string `yaml:"name"` Host string `yaml:"host"` Passwd string `yaml:"passwd"` Db int `yaml:"db"` Exts RedisConfExts `yaml:"exts"` }
RedisConf ...
type RedisConfExts ¶
type RedisConfExts struct { MaxIdle int `yaml:"maxIdle"` MaxActive int `yaml:"maxActive"` IdleTimeout string `yaml:"idleTimeout"` ConnTimeout string `yaml:"connTimeout"` MaxConnLife string `yaml:"maxConnLifetime"` TestOnBorrow string `yaml:"testOnBorrow"` }
RedisConfExts ...
Click to show internal directories.
Click to hide internal directories.