Documentation ¶
Index ¶
- Variables
- func GetIdleConn() (int, int, int, int, int)
- func Mysql() (mysql *gorm.DB, err error)
- func Open(dbType []string)
- type Condition
- type Database
- func (m *Database) Count() (count, cacheCount int, err error)
- func (m *Database) Create(u interface{}) (i interface{}, err error)
- func (m *Database) Delete(u interface{}) (b bool, err error)
- func (m *Database) Find() (replys interface{}, count int, err error)
- func (m *Database) Limit(limit interface{}) *Database
- func (m *Database) Model(model interface{}) *Database
- func (m *Database) Offset(offset interface{}) *Database
- func (m *Database) Order(order interface{}) *Database
- func (m *Database) Update(u interface{}) (i interface{}, err error)
- func (m *Database) Where(where interface{}) *Database
- type RedCache
- func (rc *RedCache) BatchCreate(m []interface{}) (err error)
- func (rc *RedCache) Count() (count int, err error)
- func (rc *RedCache) Create() (err error)
- func (rc *RedCache) Delete() (err error)
- func (rc *RedCache) GetSyncStatus() (status map[string]bool, err error)
- func (rc *RedCache) Limit(limit interface{}) *RedCache
- func (rc *RedCache) Model(model interface{}) *RedCache
- func (rc *RedCache) Offset(offset interface{}) *RedCache
- func (rc *RedCache) OrderBy(orderBy interface{}) *RedCache
- func (rc *RedCache) Select() (reply []interface{}, err error)
- func (rc *RedCache) SetSyncStatus(status map[string]bool) (reply interface{}, err error)
- func (rc *RedCache) Update() (err error)
- func (rc *RedCache) Where(where ...Condition) *RedCache
- type RedisDB
- func (redisDB *RedisDB) Bool(arg interface{}) bool
- func (redisDB *RedisDB) Del(key string) (reply interface{}, err error)
- func (redisDB *RedisDB) DelKey(key string)
- func (redisDB *RedisDB) Evalsha(args ...interface{}) (reply interface{}, err error)
- func (redisDB *RedisDB) Exists(key string) (has bool, err error)
- func (redisDB *RedisDB) Expire(key string, time int)
- func (redisDB *RedisDB) Get(key string) (reply interface{}, err error)
- func (redisDB *RedisDB) Hdel(key string, field interface{}) error
- func (redisDB *RedisDB) Hexists(key, field interface{}) (has bool, err error)
- func (redisDB *RedisDB) Hget(key string, value interface{}) (reply interface{}, err error)
- func (redisDB *RedisDB) Hgetall(key string) []interface{}
- func (redisDB *RedisDB) Hkeys(key string) []interface{}
- func (redisDB *RedisDB) Hlen(key string) int
- func (redisDB *RedisDB) Hmget(field ...interface{}) ([]interface{}, error)
- func (redisDB *RedisDB) Hmset(field ...interface{}) error
- func (redisDB *RedisDB) Hset(key string, field, value interface{}) error
- func (redisDB *RedisDB) Hsetappend(key string, field string, value string)
- func (redisDB *RedisDB) Hvals(key string) []interface{}
- func (redisDB *RedisDB) Incr() int
- func (redisDB *RedisDB) Info() (reply interface{}, err error)
- func (redisDB *RedisDB) Keys(rex string) []string
- func (redisDB *RedisDB) Llen(key interface{}) int
- func (redisDB *RedisDB) Lpush(args ...interface{})
- func (redisDB *RedisDB) Lrange(args ...interface{}) []interface{}
- func (redisDB *RedisDB) Psetex(value ...interface{}) (reply interface{}, err error)
- func (redisDB *RedisDB) Sadd(value ...interface{}) (err error)
- func (redisDB *RedisDB) ScriptRun(s string, args ...interface{}) (err error)
- func (redisDB *RedisDB) Set(value ...interface{}) (reply interface{}, err error)
- func (redisDB *RedisDB) Smembers(key, value interface{}) (reply interface{}, err error)
- func (redisDB *RedisDB) String(arg interface{}) string
- func (redisDB *RedisDB) Strings(arg interface{}) []string
- func (redisDB *RedisDB) Type(key string) string
- func (redisDB *RedisDB) Zadd(key string, sort int, value interface{}) (err error)
- func (redisDB *RedisDB) Zadds(value ...interface{}) (err error)
- func (redisDB *RedisDB) Zcard(key string) (count int, err error)
- func (redisDB *RedisDB) Zdelete(key, member string) error
- func (redisDB *RedisDB) Zinterstore(key ...interface{}) error
- func (redisDB *RedisDB) Zrange(key string, start, end interface{}) ([]interface{}, error)
- func (redisDB *RedisDB) ZrangeByLex(args ...interface{}) []interface{}
- func (redisDB *RedisDB) ZrangeByScore(args ...interface{}) []interface{}
- func (redisDB *RedisDB) Zrank(args ...interface{}) interface{}
- func (redisDB *RedisDB) Zrem(key string, args ...interface{}) (err error)
- func (redisDB *RedisDB) Zrevrange(key string, start, end interface{}) ([]interface{}, error)
- func (redisDB *RedisDB) ZrevrangeStrings(args ...interface{}) []string
- func (redisDB *RedisDB) Zunionstore(args ...interface{})
- type StructField
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //存储缓存数据加载情况,数据库和缓存数据量一致为真 SyncCache = make(map[string]bool) //是否使用缓存 UseRedcache = true )
Functions ¶
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
type RedCache ¶
type RedCache struct {
// contains filtered or unexported fields
}
func (*RedCache) BatchCreate ¶
func (*RedCache) GetSyncStatus ¶
func (*RedCache) SetSyncStatus ¶
设置同步状态
type RedisDB ¶
type RedisDB struct {
DBNum int
}
RedisDB redis 基础类
func (*RedisDB) Hsetappend ¶
Hsetappend 存储Hash型数据,把字符串用逗号分割
func (*RedisDB) Lrange ¶
func (redisDB *RedisDB) Lrange(args ...interface{}) []interface{}
Lrange 获取List型数据
func (*RedisDB) Zinterstore ¶
Zinterstore 多个key的交集
func (*RedisDB) ZrangeByLex ¶
func (redisDB *RedisDB) ZrangeByLex(args ...interface{}) []interface{}
ZrangeByLex 获取sortset型数据,参数中包含查询字符,类似于like
func (*RedisDB) ZrangeByScore ¶
func (redisDB *RedisDB) ZrangeByScore(args ...interface{}) []interface{}
ZrangeByScore 获取sortset型数据
func (*RedisDB) Zrank ¶
func (redisDB *RedisDB) Zrank(args ...interface{}) interface{}
Zrank 返回指定key的索引未知,空为没有找到
func (*RedisDB) ZrevrangeStrings ¶
ZrevrangeStrings 获取sortset型数据,从大到小,转化成字符串
func (*RedisDB) Zunionstore ¶
func (redisDB *RedisDB) Zunionstore(args ...interface{})
Zunionstore 合并多个sortset
Click to show internal directories.
Click to hide internal directories.