Documentation ¶
Index ¶
- type DataSource
- func (s DataSource) Expire(key string, seconds time.Duration) (bool, error)
- func (s DataSource) HGetAll(key string) (map[string]string, error)
- func (s DataSource) HGetInt64(key string, field string) (int64, error)
- func (s DataSource) HIncrBy(key string, field string, incValue int64) (int64, error)
- func (s DataSource) HMGetInt64(key string, fields ...string) (map[string]int64, error)
- func (s DataSource) HSet(key string, field string, val interface{}) (int64, error)
- func (s DataSource) Increase(key, field string, v int64) (newV int64, err error)
- func (s DataSource) QueryAll(key string) (values map[string]int64, err error)
- func (s DataSource) QueryByList(key string, fields ...string) (values map[string]int64, err error)
- func (s DataSource) QueryOne(key, field string) (v int64, err error)
- func (s DataSource) UpdateMax(key, field string, v int64) (newV int64, err error)
- func (s DataSource) UpdateMinus(key, field string, v int64) (newV int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSource ¶
type DataSource struct {
RedisConn *redis.Client
}
func CreateDataSource ¶
func CreateDataSource() *DataSource
func (DataSource) HGetAll ¶
func (s DataSource) HGetAll(key string) (map[string]string, error)
HGetAll 获取key里所有域&值
func (DataSource) HGetInt64 ¶
func (s DataSource) HGetInt64(key string, field string) (int64, error)
HGetInt64 获取key里指定域&值 并尝试将值转为int64
func (DataSource) HMGetInt64 ¶
HMGetInt64 获取key里指定一系列域&值 并尝试将值转为int64
func (DataSource) HSet ¶
func (s DataSource) HSet(key string, field string, val interface{}) (int64, error)
HSet 设置key里指定的域&值
func (DataSource) Increase ¶
func (s DataSource) Increase(key, field string, v int64) (newV int64, err error)
Increase 增加
func (DataSource) QueryAll ¶
func (s DataSource) QueryAll(key string) (values map[string]int64, err error)
QueryAll 查询指定key的所有域数据
func (DataSource) QueryByList ¶
QueryByList 根据指定域查询多个数据
func (DataSource) QueryOne ¶
func (s DataSource) QueryOne(key, field string) (v int64, err error)
QueryOne 查询指定一个数据
func (DataSource) UpdateMax ¶
func (s DataSource) UpdateMax(key, field string, v int64) (newV int64, err error)
UpdateMax 更新最大值
func (DataSource) UpdateMinus ¶
func (s DataSource) UpdateMinus(key, field string, v int64) (newV int64, err error)
UpdateMinus 更新最小值
Click to show internal directories.
Click to hide internal directories.