Documentation ¶
Index ¶
- func FileStat(file string) string
- func InitConfToml(file string, ConfMap interface{})
- func Loginit(name string) *log.Logger
- type Err
- type MysqlConnConf
- type MysqlConnConfMap
- type RedisConnConf
- type RedisConnConfMap
- type RedisType
- func (r RedisType) Del(k interface{}) (err error)
- func (r RedisType) Get(k interface{}) (value string, err error)
- func (r RedisType) HDel(name, k interface{}) (err error)
- func (r RedisType) HGet(name, k interface{}) (value interface{}, err error)
- func (r RedisType) HGetAll(name interface{}) (value map[string]string, err error)
- func (r RedisType) HKeys(hName interface{}) (value []string, err error)
- func (r RedisType) HSet(name, k, v interface{}) (err error)
- func (r RedisType) IncrBy(k string, v interface{}) (reply interface{}, err error)
- func (r RedisType) LPop(k string) (reply string, err error)
- func (r RedisType) LPush(k string, v interface{}) (err error)
- func (r RedisType) LRang(k string) (reply []int, err error)
- func (r RedisType) LRem(k string, v interface{}) (err error)
- func (r RedisType) RPop(k string) (reply string, err error)
- func (r RedisType) RPush(k string, v interface{}) (err error)
- func (r RedisType) Set(k, v interface{}, expire ...int) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MysqlConnConf ¶
type MysqlConnConf struct { DriverName string `toml:"driver_name"` Host string `toml:"host"` Database string `toml:"database"` User string `toml:"user"` Password string `toml:"password"` Port uint `toml:"port"` MaxIdleConn int `toml:"max_idle_conn"` //用于设置闲置的连接数。 MaxOpenConn int `toml:"max_open_conn"` //用于设置最大打开的连接数,默认值为0表示不限制 SqlLog bool `toml:"sql_log"` //是否打印sql }
func (*MysqlConnConf) GetPool ¶
func (conf *MysqlConnConf) GetPool(tomlName string) *gorm.DB
get database by name
func (*MysqlConnConf) InitMysqlToml ¶
func (conf *MysqlConnConf) InitMysqlToml(file string)
type MysqlConnConfMap ¶
type MysqlConnConfMap struct {
Mysql map[string]*MysqlConnConf `toml:"mysql"`
}
var MysqlConfMapList MysqlConnConfMap
type RedisConnConf ¶
redis
func (*RedisConnConf) GetPool ¶
func (redisConf *RedisConnConf) GetPool(tomlName string) *redis.Pool
get conn pool
func (*RedisConnConf) InitRedisToml ¶
func (redisConf *RedisConnConf) InitRedisToml(file string)
init toml
type RedisConnConfMap ¶
type RedisConnConfMap struct {
Redis map[string]*RedisConnConf `toml:"redis"`
}
conn list
var RedisConfMap RedisConnConfMap
Click to show internal directories.
Click to hide internal directories.