Documentation ¶
Index ¶
- Constants
- Variables
- type Options
- type Redis
- func (r *Redis) CreateQueue(ctx context.Context, k string) error
- func (r *Redis) Destroy(ctx context.Context, key string) error
- func (r *Redis) Do(ctx context.Context, key string, time int) error
- func (r *Redis) Expire(ctx context.Context, k string, expire time.Duration) error
- func (r *Redis) Get(ctx context.Context, k string) (string, error)
- func (r *Redis) GetOriginPoint() *redis.Client
- func (r *Redis) HDel(ctx context.Context, k string, field string) error
- func (r *Redis) HGet(ctx context.Context, k, field string) (string, error)
- func (r *Redis) HGetAllByScan(ctx context.Context, k string) (result map[string]string, err error)
- func (r *Redis) HSet(ctx context.Context, k string, fields ...string) error
- func (r *Redis) Incr(ctx context.Context, key string) (int64, error)
- func (r *Redis) Pop(ctx context.Context, k string) <-chan string
- func (r *Redis) Push(ctx context.Context, k, field string) error
- func (r *Redis) Scan(ctx context.Context, cursor uint64, match string, count int64) (keys []string, newCursor uint64, err error)
- func (r *Redis) Set(ctx context.Context, k, v string, expires time.Duration) error
- func (r *Redis) SetNx(ctx context.Context, key, val string, expire time.Duration) (bool, error)
- func (r *Redis) Subscribe(k string, pb func(message string))
- func (r *Redis) SubscribeAllEvents(pb func(message string))
Constants ¶
View Source
const GlobalEvent = "global_event"
Variables ¶
View Source
var Client = New(ctx, Options{
Addr: "127.0.0.0:6379",
Password: "",
DB: 0,
})
Functions ¶
This section is empty.
Types ¶
type Redis ¶
type Redis struct { // 订阅服务器实例 Point *redis.Client // 订阅列表 PbFns sync.Map // contains filtered or unexported fields }
func (*Redis) GetOriginPoint ¶
func (r *Redis) GetOriginPoint() *redis.Client
GetOriginPoint 获取原始redis实例
func (*Redis) HGetAllByScan ¶
func (*Redis) SubscribeAllEvents ¶
SubscribeAllEvents 订阅所有键过期事件
Click to show internal directories.
Click to hide internal directories.