Documentation
¶
Index ¶
- func InitLog(logConf Log) *logs.BeeLogger
- func NewGorm(conf *Config) (*gorm.DB, error)
- type Config
- type FileUpload
- type Gorm
- type HTTP
- type Log
- type MySQL
- type Redis
- type RedisConnPool
- func (p *RedisConnPool) CheckSETString(key, value string) (int, error)
- func (p *RedisConnPool) Close() error
- func (p *RedisConnPool) DelKey(key string) (interface{}, error)
- func (p *RedisConnPool) DelSETKeyValue(key string, value ...string) (int64, error)
- func (p *RedisConnPool) Do(command string, args ...interface{}) (interface{}, error)
- func (p *RedisConnPool) ExpireKey(key string, seconds int64) (interface{}, error)
- func (p *RedisConnPool) GetBytes(key string) ([]byte, error)
- func (p *RedisConnPool) GetFristDel(key string) (interface{}, error)
- func (p *RedisConnPool) GetHashMapInt(key string) (map[string]int, error)
- func (p *RedisConnPool) GetHashMapInt64(key string) (map[string]int64, error)
- func (p *RedisConnPool) GetHashMapString(key string) (map[string]string, error)
- func (p *RedisConnPool) GetInt(key string) (int, error)
- func (p *RedisConnPool) GetInt64(key string) (int64, error)
- func (p *RedisConnPool) GetLastDel(key string) (interface{}, error)
- func (p *RedisConnPool) GetListString(key string) ([]string, error)
- func (p *RedisConnPool) GetSETCount(key string) (int64, error)
- func (p *RedisConnPool) GetSETRandStringRm(key string) (string, error)
- func (p *RedisConnPool) GetString(key string) (string, error)
- func (p *RedisConnPool) Keys(pattern string) ([]string, error)
- func (p *RedisConnPool) KeysByteSlices(pattern string) ([][]byte, error)
- func (p *RedisConnPool) SetAndExpire(key string, value interface{}, expire int64) (interface{}, error)
- func (p *RedisConnPool) SetHashMap(key string, fieldValue map[string]interface{}) (interface{}, error)
- func (p *RedisConnPool) SetList(key string, list []string) (interface{}, error)
- func (p *RedisConnPool) SetSETString(key string, value string) (int, error)
- func (p *RedisConnPool) SetString(key string, value interface{}) (interface{}, error)
- func (p *RedisConnPool) SetStringList(key string, s string) (interface{}, error)
- type USession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Log Log `toml:"log"`
Gorm Gorm `toml:"gorm"`
MySQL MySQL `toml:"mysql"`
HTTP HTTP `toml:"http"`
Redis Redis `toml:"redis"`
FileUpload FileUpload `toml:"fileUpload"`
}
Config 配置参数
func LoadGlobalConfig ¶
LoadGlobalConfig 加载全局配置
type FileUpload ¶
type FileUpload struct {
BasePath string `toml:"basePath"`
Path string `toml:"path"`
DoMain string `toml:"doMain"`
MaxFileSize int64 `toml:"maxFileSize"`
ExtFilter string `toml:"extFilter"`
}
FileUpload 文件上传配置参数
type Gorm ¶
type Gorm struct {
Debug bool `toml:"debug"`
DBType string `toml:"db_type"`
MaxLifetime int `toml:"max_lifetime"`
MaxOpenConns int `toml:"max_open_conns"`
MaxIdleConns int `toml:"max_idle_conns"`
TablePrefix string `toml:"table_prefix"`
}
Gorm gorm配置参数
type HTTP ¶
type HTTP struct {
Host string `toml:"host"`
Port int `toml:"port"`
ShutdownTimeout int `toml:"shutdown_timeout"`
}
HTTP http配置参数
type Log ¶
type Log struct {
Level int `toml:"level"`
Path string `toml:"path"`
MaxDays int `toml:"maxdays"`
Separate string `toml:"separate"`
}
Log 日志配置参数
type MySQL ¶
type MySQL struct {
Host string `toml:"host"`
Port int `toml:"port"`
User string `toml:"user"`
Password string `toml:"password"`
DBName string `toml:"db_name"`
Parameters string `toml:"parameters"`
}
MySQL mysql配置参数
type Redis ¶
type Redis struct {
Addr string `toml:"addr"`
Password string `toml:"password"`
Database int `toml:"database"`
MaxOpenConns int `toml:"maxOpenConns"`
MaxIdleConns int `toml:"maxIdleConns"`
}
Redis redis配置参数
type RedisConnPool ¶
type RedisConnPool struct {
// contains filtered or unexported fields
}
func InitRedis ¶
func InitRedis(red Redis) *RedisConnPool
func (*RedisConnPool) CheckSETString ¶
func (p *RedisConnPool) CheckSETString(key, value string) (int, error)
func (*RedisConnPool) DelKey ¶
func (p *RedisConnPool) DelKey(key string) (interface{}, error)
// Key(键)
func (*RedisConnPool) DelSETKeyValue ¶
func (p *RedisConnPool) DelSETKeyValue(key string, value ...string) (int64, error)
func (*RedisConnPool) Do ¶
func (p *RedisConnPool) Do(command string, args ...interface{}) (interface{}, error)
当前某一个数据库,执行命令
func (*RedisConnPool) ExpireKey ¶
func (p *RedisConnPool) ExpireKey(key string, seconds int64) (interface{}, error)
func (*RedisConnPool) GetFristDel ¶
func (p *RedisConnPool) GetFristDel(key string) (interface{}, error)
func (*RedisConnPool) GetHashMapInt ¶
func (p *RedisConnPool) GetHashMapInt(key string) (map[string]int, error)
func (*RedisConnPool) GetHashMapInt64 ¶
func (p *RedisConnPool) GetHashMapInt64(key string) (map[string]int64, error)
func (*RedisConnPool) GetHashMapString ¶
func (p *RedisConnPool) GetHashMapString(key string) (map[string]string, error)
func (*RedisConnPool) GetLastDel ¶
func (p *RedisConnPool) GetLastDel(key string) (interface{}, error)
func (*RedisConnPool) GetListString ¶
func (p *RedisConnPool) GetListString(key string) ([]string, error)
func (*RedisConnPool) GetSETCount ¶
func (p *RedisConnPool) GetSETCount(key string) (int64, error)
func (*RedisConnPool) GetSETRandStringRm ¶
func (p *RedisConnPool) GetSETRandStringRm(key string) (string, error)
func (*RedisConnPool) KeysByteSlices ¶
func (p *RedisConnPool) KeysByteSlices(pattern string) ([][]byte, error)
func (*RedisConnPool) SetAndExpire ¶
func (p *RedisConnPool) SetAndExpire(key string, value interface{}, expire int64) (interface{}, error)
// String(字符串)
func (*RedisConnPool) SetHashMap ¶
func (p *RedisConnPool) SetHashMap(key string, fieldValue map[string]interface{}) (interface{}, error)
// Hash(哈希表)
func (*RedisConnPool) SetList ¶
func (p *RedisConnPool) SetList(key string, list []string) (interface{}, error)
func (*RedisConnPool) SetSETString ¶
func (p *RedisConnPool) SetSETString(key string, value string) (int, error)
func (*RedisConnPool) SetString ¶
func (p *RedisConnPool) SetString(key string, value interface{}) (interface{}, error)
// String(字符串)
func (*RedisConnPool) SetStringList ¶
func (p *RedisConnPool) SetStringList(key string, s string) (interface{}, error)
type USession ¶
func GetSession ¶
Click to show internal directories.
Click to hide internal directories.