zsetx.go 367 B

1234567891011121314151617
  1. package redisx
  2. import (
  3. "context"
  4. "github.com/redis/go-redis/v9"
  5. )
  6. // 有序集合封装
  7. func ZAdd(ctx context.Context, key string, members ...redis.Z) error {
  8. return getClient().ZAdd(ctx, key, members...).Err()
  9. }
  10. func ZRange(ctx context.Context, key string, start, stop int64) ([]string, error) {
  11. return getClient().ZRange(ctx, key, start, stop).Result()
  12. }