Documentation ¶
Index ¶
- Constants
- Variables
- func GetEmptyCache() *gocache.Cache
- func GetMemoryCache() *gocache.Cache
- func GetRedisCli() redisc.Client
- func Hash(data []byte) uint64
- func InitMemoryCache(expire time.Duration, clean time.Duration)
- func InitRedis(ctx context.Context, config redisc.Config) (err error)
- type BloomFilter
- type RedisConfig
- type RedisDriver
- func (d *RedisDriver) BasicGet(key string) interface{}
- func (d *RedisDriver) BasicSet(key string, value interface{}, expir time.Duration, typ actionType) (e error)
- func (d *RedisDriver) NewBitSet(key string, bits uint) *redisBitSet
- func (d *RedisDriver) NewBloomFilter(bits uint, key string) *BloomFilter
- func (d *RedisDriver) NewLock(key string) *RedisLock
- func (d *RedisDriver) Ping() bool
- type RedisLock
Constants ¶
View Source
const ( RedisStr actionType = iota // 字符串类型 RedisList // 列表类型 RedisHash // 哈希类型 RedisSortSet // 排序集合类型 RedisSet // 集合类型 )
View Source
const DefaultMaxLimit = 10000
Variables ¶
View Source
var ErrTooLargeOffset = errors.New("too large offset")
ErrTooLargeOffset indicates the offset is too large in bitset.
Functions ¶
func GetEmptyCache ¶
func GetMemoryCache ¶
func GetRedisCli ¶
Types ¶
type BloomFilter ¶
type BloomFilter struct {
// contains filtered or unexported fields
}
布隆过滤器结构体
func (*BloomFilter) Add ¶
func (f *BloomFilter) Add(data []byte) error
type RedisConfig ¶
func (RedisConfig) DSN ¶
func (c RedisConfig) DSN() interface{}
type RedisDriver ¶
type RedisDriver struct { Client *redis.Client // contains filtered or unexported fields }
func NewRedisDriver ¶
func NewRedisDriver(config *RedisConfig) (*RedisDriver, error)
NewRedisDriver driver构造函数
func (*RedisDriver) BasicSet ¶
func (d *RedisDriver) BasicSet(key string, value interface{}, expir time.Duration, typ actionType) (e error)
BasicSet 基本数据类型的添加元素
func (*RedisDriver) NewBitSet ¶
func (d *RedisDriver) NewBitSet(key string, bits uint) *redisBitSet
获取bitset数据结构
func (*RedisDriver) NewBloomFilter ¶
func (d *RedisDriver) NewBloomFilter(bits uint, key string) *BloomFilter
布隆过滤器的构造函数
Click to show internal directories.
Click to hide internal directories.