listx.go 420 B

1234567891011121314151617
  1. package redisx
  2. import "context"
  3. // 列表封装
  4. func LPush(ctx context.Context, key string, values ...interface{}) error {
  5. return getClient().LPush(ctx, key, values...).Err()
  6. }
  7. func RPush(ctx context.Context, key string, values ...interface{}) error {
  8. return getClient().RPush(ctx, key, values...).Err()
  9. }
  10. func LPop(ctx context.Context, key string) (string, error) {
  11. return getClient().LPop(ctx, key).Result()
  12. }