Documentation
¶
Index ¶
- func GetRediClient(config map[string]string) (*redis.Client, error)
- type IRedisRepository
- type RedisContent
- type ReidsRepository
- func (redi *ReidsRepository) Append(key string, value string) (int64, error)
- func (reid *ReidsRepository) Get(key string, result interface{}) error
- func (reid *ReidsRepository) GetMany(keys []string, result interface{}) error
- func (redi *ReidsRepository) Remove(keys ...string) (int64, error)
- func (redi *ReidsRepository) Set(key string, entity interface{}, expiration time.Duration) (int64, error)
- func (redi *ReidsRepository) SetMany(entityMap map[string]interface{}, expiration time.Duration) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IRedisRepository ¶
type IRedisRepository interface {
// 插入单个
// entity 结构体
// expSecond 0为永不到期
Set(key string, entity interface{}, expiration time.Duration) (int64, error)
// 插入多个
// entityMap 结构体字典
// expSecond 0为永不到期
SetMany(entityMap map[string]interface{}, expiration time.Duration) (int64, error)
//添加加字符串
Append(key string, value string) (int64, error)
// 删除单个
// key key值
Remove(key ...string) (int64, error)
//查询单个
// key key值
// result 查询的结果
Get(key string, result interface{}) error
//查询多个[只支持string类型]
// keys key值切片
// result 查询的结果切片
GetMany(keys []string, result interface{}) error
}
redis 仓储接口(只支持string类型)
type RedisContent ¶
集合上下文
func DataBaseMapping ¶
func DataBaseMapping(client *redis.Client) *RedisContent
添加映射 @client 连接对象 @dataName 数据库名
func (*RedisContent) GetRedisRepository ¶
func (redi *RedisContent) GetRedisRepository(entity interface{}) IRedisRepository
获取集合仓储 entity 结构体
type ReidsRepository ¶
Reids 仓储(string)
func (*ReidsRepository) Append ¶
func (redi *ReidsRepository) Append(key string, value string) (int64, error)
往key后面添加字符串 key key值 value 要添加的字符串
func (*ReidsRepository) Get ¶
func (reid *ReidsRepository) Get(key string, result interface{}) error
查询单个 key key值 result 查询的结果
func (*ReidsRepository) GetMany ¶
func (reid *ReidsRepository) GetMany(keys []string, result interface{}) error
查询多个 keys key值切片 result 查询的结果切片
func (*ReidsRepository) Remove ¶
func (redi *ReidsRepository) Remove(keys ...string) (int64, error)
移除 keys key值切片
Click to show internal directories.
Click to hide internal directories.