-
Notifications
You must be signed in to change notification settings - Fork 10
/
list.go
46 lines (35 loc) · 1.42 KB
/
list.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package redis
import (
"context"
"time"
)
func (r *redis) LPush(ctx context.Context, key string, values ...interface{}) (int64, error) {
return r.client.LPush(ctx, key, values...).Result()
}
func (r *redis) RPush(ctx context.Context, key string, values ...interface{}) (int64, error) {
return r.client.RPush(ctx, key, values...).Result()
}
func (r *redis) RPop(ctx context.Context, key string) (string, error) {
return r.client.RPop(ctx, key).Result()
}
func (r *redis) BRPop(ctx context.Context, key string, blockTime time.Duration) ([]string, error) {
return r.client.BRPop(ctx, blockTime, key).Result()
}
func (r *redis) LPop(ctx context.Context, key string) (string, error) {
return r.client.LPop(ctx, key).Result()
}
func (r *redis) LRange(ctx context.Context, key string, start, stop int64) ([]string, error) {
return r.client.LRange(ctx, key, start, stop).Result()
}
func (r *redis) LLen(ctx context.Context, key string) (int64, error) {
return r.client.LLen(ctx, key).Result()
}
func (r *redis) LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error) {
return r.client.LRem(ctx, key, count, value).Result()
}
func (r *redis) LIndex(ctx context.Context, key string, idx int64) (string, error) {
return r.client.LIndex(ctx, key, idx).Result()
}
func (r *redis) LTrim(ctx context.Context, key string, start, stop int64) (string, error) {
return r.client.LTrim(ctx, key, start, stop).Result()
}