Documentation
¶
Index ¶
- Constants
- type Cache
- type Redis
- func (r *Redis) Get(k string) (string, error)
- func (r *Redis) GetOriginPoint() *redis.Client
- func (r *Redis) Scan(cursor uint64, match string, count int64) (keys []string, newCursor uint64, err error)
- func (r *Redis) Set(k, v string, expires time.Duration) error
- func (r *Redis) Subscribe(k string, pb func(message string))
- func (r *Redis) SubscribeAllEvents(pb func(message string))
- type RedisOptions
Constants ¶
View Source
const GlobalEvent = "global_event"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct { //订阅服务器实例 Point *redis.Client //订阅列表 PbFns sync.Map // contains filtered or unexported fields }
func NewRedis ¶
func NewRedis(options RedisOptions) *Redis
func (*Redis) GetOriginPoint ¶
func (r *Redis) GetOriginPoint() *redis.Client
GetOriginPoint 获取原始redis实例
func (*Redis) SubscribeAllEvents ¶
SubscribeAllEvents 订阅所有键过期事件
type RedisOptions ¶
Click to show internal directories.
Click to hide internal directories.