Versions in this module Expand all Collapse all v1 v1.4.1 May 3, 2026 Changes in this version type Client + func (c *Client) GetDelBytes(ctx context.Context, key string) ([]byte, error) + func (c *Client) HSetBytes(ctx context.Context, key, field string, value []byte) (int64, error) + func (c *Client) HSetNXBytes(ctx context.Context, key, field string, value []byte) (bool, error) + func (c *Client) LPushBytes(ctx context.Context, key string, values ...[]byte) (int64, error) + func (c *Client) RPushBytes(ctx context.Context, key string, values ...[]byte) (int64, error) + func (c *Client) SetBytes(ctx context.Context, key string, value []byte, expiration time.Duration) error + func (c *Client) SetEXBytes(ctx context.Context, key string, value []byte, ttl time.Duration) error + func (c *Client) SetNXBytes(ctx context.Context, key string, value []byte, expiration time.Duration) (bool, error) type ClusterTx + func (t *ClusterTx) HSetBytes(key, field string, value []byte) *IntCmd + func (t *ClusterTx) LPushBytes(key string, values ...[]byte) *IntCmd + func (t *ClusterTx) RPushBytes(key string, values ...[]byte) *IntCmd + func (t *ClusterTx) SetBytes(key string, value []byte, expiration time.Duration) *StatusCmd type Pipeline + func (p *Pipeline) SetBytes(key string, value []byte, expiration time.Duration) *StatusCmd v1.4.0 Apr 19, 2026 Changes in this version + var ErrAsk = errors.New("celeris-redis: ASK redirect") + var ErrClosed = errors.New("celeris-redis: client closed") + var ErrClusterMaxRedirects = errors.New("celeris-redis: cluster max redirects exceeded") + var ErrCrossSlot = errors.New(...) + var ErrMoved = errors.New("celeris-redis: MOVED redirect") + var ErrNil = errors.New("celeris-redis: nil") + var ErrPoolExhausted = errors.New("celeris-redis: pool exhausted") + var ErrProtocol = errors.New("celeris-redis: protocol error") + var ErrSentinelUnhealthy = errors.New("celeris-redis: sentinel client unhealthy, failover dial failed") + var ErrTxAborted = errors.New("celeris-redis: transaction aborted") + var ErrWrongType = errors.New(...) + func Slot(key string) uint16 + func WithWorker(ctx context.Context, workerID int) context.Context + type BoolCmd struct + func (c *BoolCmd) Result() (bool, error) + type Client struct + func NewClient(addr string, opts ...Option) (*Client, error) + func (c *Client) Append(ctx context.Context, key string, value string) (int64, error) + func (c *Client) Close() error + func (c *Client) DBSize(ctx context.Context) (int64, error) + func (c *Client) Decr(ctx context.Context, key string) (int64, error) + func (c *Client) DecrBy(ctx context.Context, key string, val int64) (int64, error) + func (c *Client) Del(ctx context.Context, keys ...string) (int64, error) + func (c *Client) Do(ctx context.Context, args ...any) (*protocol.Value, error) + func (c *Client) DoBool(ctx context.Context, args ...any) (bool, error) + func (c *Client) DoInt(ctx context.Context, args ...any) (int64, error) + func (c *Client) DoSlice(ctx context.Context, args ...any) ([]string, error) + func (c *Client) DoString(ctx context.Context, args ...any) (string, error) + func (c *Client) Eval(ctx context.Context, script string, keys []string, args ...any) (*protocol.Value, error) + func (c *Client) EvalSHA(ctx context.Context, sha string, keys []string, args ...any) (*protocol.Value, error) + func (c *Client) Exists(ctx context.Context, keys ...string) (int64, error) + func (c *Client) Expire(ctx context.Context, key string, expiration time.Duration) (bool, error) + func (c *Client) ExpireAt(ctx context.Context, key string, at time.Time) (bool, error) + func (c *Client) FlushDB(ctx context.Context) error + func (c *Client) Get(ctx context.Context, key string) (string, error) + func (c *Client) GetBytes(ctx context.Context, key string) ([]byte, error) + func (c *Client) GetDel(ctx context.Context, key string) (string, error) + func (c *Client) HDel(ctx context.Context, key string, fields ...string) (int64, error) + func (c *Client) HExists(ctx context.Context, key, field string) (bool, error) + func (c *Client) HGet(ctx context.Context, key, field string) (string, error) + func (c *Client) HGetAll(ctx context.Context, key string) (map[string]string, error) + func (c *Client) HIncrBy(ctx context.Context, key, field string, incr int64) (int64, error) + func (c *Client) HIncrByFloat(ctx context.Context, key, field string, incr float64) (float64, error) + func (c *Client) HKeys(ctx context.Context, key string) ([]string, error) + func (c *Client) HLen(ctx context.Context, key string) (int64, error) + func (c *Client) HMGet(ctx context.Context, key string, fields ...string) ([]string, error) + func (c *Client) HSet(ctx context.Context, key string, values ...any) (int64, error) + func (c *Client) HSetNX(ctx context.Context, key, field string, value any) (bool, error) + func (c *Client) HVals(ctx context.Context, key string) ([]string, error) + func (c *Client) IdleConnWorkers() []int + func (c *Client) Incr(ctx context.Context, key string) (int64, error) + func (c *Client) IncrBy(ctx context.Context, key string, val int64) (int64, error) + func (c *Client) IncrByFloat(ctx context.Context, key string, val float64) (float64, error) + func (c *Client) LIndex(ctx context.Context, key string, index int64) (string, error) + func (c *Client) LLen(ctx context.Context, key string) (int64, error) + func (c *Client) LPop(ctx context.Context, key string) (string, error) + func (c *Client) LPush(ctx context.Context, key string, values ...any) (int64, error) + func (c *Client) LRange(ctx context.Context, key string, start, stop int64) ([]string, error) + func (c *Client) LRem(ctx context.Context, key string, count int64, element any) (int64, error) + func (c *Client) MGet(ctx context.Context, keys ...string) ([]string, error) + func (c *Client) MSet(ctx context.Context, pairs ...any) error + func (c *Client) OnPush(fn func(channel string, data []protocol.Value)) + func (c *Client) PExpire(ctx context.Context, key string, ms time.Duration) (bool, error) + func (c *Client) PExpireAt(ctx context.Context, key string, at time.Time) (bool, error) + func (c *Client) PSubscribe(ctx context.Context, patterns ...string) (*PubSub, error) + func (c *Client) PTTL(ctx context.Context, key string) (time.Duration, error) + func (c *Client) Persist(ctx context.Context, key string) (bool, error) + func (c *Client) Ping(ctx context.Context) error + func (c *Client) Pipeline() *Pipeline + func (c *Client) Proto() int + func (c *Client) Publish(ctx context.Context, channel, message string) (int64, error) + func (c *Client) RPop(ctx context.Context, key string) (string, error) + func (c *Client) RPush(ctx context.Context, key string, values ...any) (int64, error) + func (c *Client) RandomKey(ctx context.Context) (string, error) + func (c *Client) Rename(ctx context.Context, key, newKey string) error + func (c *Client) SAdd(ctx context.Context, key string, members ...any) (int64, error) + func (c *Client) SCard(ctx context.Context, key string) (int64, error) + func (c *Client) SDiff(ctx context.Context, keys ...string) ([]string, error) + func (c *Client) SInter(ctx context.Context, keys ...string) ([]string, error) + func (c *Client) SIsMember(ctx context.Context, key string, member any) (bool, error) + func (c *Client) SMembers(ctx context.Context, key string) ([]string, error) + func (c *Client) SRem(ctx context.Context, key string, members ...any) (int64, error) + func (c *Client) SUnion(ctx context.Context, keys ...string) ([]string, error) + func (c *Client) Scan(_ context.Context, match string, count int64) *ScanIterator + func (c *Client) ScriptLoad(ctx context.Context, script string) (string, error) + func (c *Client) Set(ctx context.Context, key string, value any, expiration time.Duration) error + func (c *Client) SetEX(ctx context.Context, key string, value any, ttl time.Duration) error + func (c *Client) SetNX(ctx context.Context, key string, value any, expiration time.Duration) (bool, error) + func (c *Client) Stats() async.PoolStats + func (c *Client) Subscribe(ctx context.Context, channels ...string) (*PubSub, error) + func (c *Client) TTL(ctx context.Context, key string) (time.Duration, error) + func (c *Client) TxPipeline(ctx context.Context) (*Tx, error) + func (c *Client) Type(ctx context.Context, key string) (string, error) + func (c *Client) Watch(ctx context.Context, fn func(tx *Tx) error, keys ...string) error + func (c *Client) ZAdd(ctx context.Context, key string, members ...Z) (int64, error) + func (c *Client) ZCard(ctx context.Context, key string) (int64, error) + func (c *Client) ZCount(ctx context.Context, key, minScore, maxScore string) (int64, error) + func (c *Client) ZIncrBy(ctx context.Context, key string, incr float64, member string) (float64, error) + func (c *Client) ZRange(ctx context.Context, key string, start, stop int64) ([]string, error) + func (c *Client) ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) ([]string, error) + func (c *Client) ZRank(ctx context.Context, key, member string) (int64, error) + func (c *Client) ZRem(ctx context.Context, key string, members ...any) (int64, error) + func (c *Client) ZRevRange(ctx context.Context, key string, start, stop int64) ([]string, error) + func (c *Client) ZScore(ctx context.Context, key, member string) (float64, error) + type ClusterClient struct + func NewClusterClient(cfg ClusterConfig) (*ClusterClient, error) + func (c *ClusterClient) Close() error + func (c *ClusterClient) Decr(ctx context.Context, key string) (int64, error) + func (c *ClusterClient) Del(ctx context.Context, keys ...string) (int64, error) + func (c *ClusterClient) Do(ctx context.Context, args ...any) (*protocol.Value, error) + func (c *ClusterClient) Exists(ctx context.Context, keys ...string) (int64, error) + func (c *ClusterClient) Expire(ctx context.Context, key string, expiration time.Duration) (bool, error) + func (c *ClusterClient) ForEachNode(_ context.Context, fn func(*Client) error) error + func (c *ClusterClient) Get(ctx context.Context, key string) (string, error) + func (c *ClusterClient) GetBytes(ctx context.Context, key string) ([]byte, error) + func (c *ClusterClient) HDel(ctx context.Context, key string, fields ...string) (int64, error) + func (c *ClusterClient) HGet(ctx context.Context, key, field string) (string, error) + func (c *ClusterClient) HGetAll(ctx context.Context, key string) (map[string]string, error) + func (c *ClusterClient) HSet(ctx context.Context, key string, values ...any) (int64, error) + func (c *ClusterClient) Incr(ctx context.Context, key string) (int64, error) + func (c *ClusterClient) LPop(ctx context.Context, key string) (string, error) + func (c *ClusterClient) LPush(ctx context.Context, key string, values ...any) (int64, error) + func (c *ClusterClient) LRange(ctx context.Context, key string, start, stop int64) ([]string, error) + func (c *ClusterClient) Ping(ctx context.Context) error + func (c *ClusterClient) Pipeline() *ClusterPipeline + func (c *ClusterClient) Publish(ctx context.Context, channel, message string) (int64, error) + func (c *ClusterClient) RPop(ctx context.Context, key string) (string, error) + func (c *ClusterClient) RPush(ctx context.Context, key string, values ...any) (int64, error) + func (c *ClusterClient) SAdd(ctx context.Context, key string, members ...any) (int64, error) + func (c *ClusterClient) SMembers(ctx context.Context, key string) ([]string, error) + func (c *ClusterClient) SPublish(ctx context.Context, channel, message string) (int64, error) + func (c *ClusterClient) SSubscribe(ctx context.Context, channels ...string) (*PubSub, error) + func (c *ClusterClient) Set(ctx context.Context, key string, value any, ttl time.Duration) error + func (c *ClusterClient) SetNX(ctx context.Context, key string, value any, ttl time.Duration) (bool, error) + func (c *ClusterClient) Subscribe(ctx context.Context, channels ...string) (*PubSub, error) + func (c *ClusterClient) TTL(ctx context.Context, key string) (time.Duration, error) + func (c *ClusterClient) TxPipeline() *ClusterTx + func (c *ClusterClient) Watch(ctx context.Context, fn func(tx *Tx) error, keys ...string) error + func (c *ClusterClient) ZAdd(ctx context.Context, key string, members ...Z) (int64, error) + func (c *ClusterClient) ZRange(ctx context.Context, key string, start, stop int64) ([]string, error) + type ClusterConfig struct + Addrs []string + DialTimeout time.Duration + Engine eventloop.ServerProvider + MaxIdlePerWorker int + MaxRedirects int + Password string + PoolSize int + ReadOnly bool + ReadTimeout time.Duration + RouteByLatency bool + Username string + WriteTimeout time.Duration + type ClusterPipeline struct + func (cp *ClusterPipeline) Discard() + func (cp *ClusterPipeline) Exec(ctx context.Context) ([]protocol.Value, []error) + func (cp *ClusterPipeline) Get(key string) int + func (cp *ClusterPipeline) Set(key string, value any, ttl time.Duration) int + type ClusterTx struct + func (t *ClusterTx) Decr(key string) *IntCmd + func (t *ClusterTx) Del(keys ...string) *IntCmd + func (t *ClusterTx) Discard() + func (t *ClusterTx) Exec(ctx context.Context) error + func (t *ClusterTx) Exists(keys ...string) *IntCmd + func (t *ClusterTx) Expire(key string, d time.Duration) *BoolCmd + func (t *ClusterTx) Get(key string) *StringCmd + func (t *ClusterTx) HGet(key, field string) *StringCmd + func (t *ClusterTx) HSet(key string, values ...any) *IntCmd + func (t *ClusterTx) Incr(key string) *IntCmd + func (t *ClusterTx) LPush(key string, values ...any) *IntCmd + func (t *ClusterTx) RPush(key string, values ...any) *IntCmd + func (t *ClusterTx) SAdd(key string, members ...any) *IntCmd + func (t *ClusterTx) Set(key string, value any, expiration time.Duration) *StatusCmd + func (t *ClusterTx) ZAdd(key string, members ...Z) *IntCmd + type Config struct + Addr string + DB int + DialTimeout time.Duration + Engine eventloop.ServerProvider + ForceRESP2 bool + HealthCheckInterval time.Duration + MaxIdlePerWorker int + MaxIdleTime time.Duration + MaxLifetime time.Duration + OnPush func(channel string, data []protocol.Value) + Password string + PoolSize int + Proto int + ReadTimeout time.Duration + Username string + WriteTimeout time.Duration + type FloatCmd struct + func (c *FloatCmd) Result() (float64, error) + type IntCmd struct + func (c *IntCmd) Result() (int64, error) + type Message struct + Channel string + Pattern string + Payload string + Shard bool + type Option func(*Config) + func WithDB(db int) Option + func WithDialTimeout(d time.Duration) Option + func WithEngine(sp eventloop.ServerProvider) Option + func WithForceRESP2() Option + func WithHealthCheckInterval(d time.Duration) Option + func WithMaxIdlePerWorker(n int) Option + func WithMaxIdleTime(d time.Duration) Option + func WithMaxLifetime(d time.Duration) Option + func WithOnPush(fn func(channel string, data []protocol.Value)) Option + func WithPassword(s string) Option + func WithPoolSize(n int) Option + func WithProto(p int) Option + func WithReadTimeout(d time.Duration) Option + func WithUsername(s string) Option + func WithWriteTimeout(d time.Duration) Option + type Pipeline struct + func (p *Pipeline) Decr(key string) *IntCmd + func (p *Pipeline) Del(keys ...string) *IntCmd + func (p *Pipeline) Discard() + func (p *Pipeline) Exec(ctx context.Context) error + func (p *Pipeline) Exists(keys ...string) *IntCmd + func (p *Pipeline) Expire(key string, d time.Duration) *BoolCmd + func (p *Pipeline) Get(key string) *StringCmd + func (p *Pipeline) HGet(key, field string) *StringCmd + func (p *Pipeline) HSet(key string, values ...any) *IntCmd + func (p *Pipeline) Incr(key string) *IntCmd + func (p *Pipeline) LPush(key string, values ...any) *IntCmd + func (p *Pipeline) RPush(key string, values ...any) *IntCmd + func (p *Pipeline) Release() + func (p *Pipeline) SAdd(key string, members ...any) *IntCmd + func (p *Pipeline) Set(key string, value any, expiration time.Duration) *StatusCmd + func (p *Pipeline) ZAdd(key string, members ...Z) *IntCmd + type PubSub struct + func (ps *PubSub) Channel() <-chan *Message + func (ps *PubSub) Close() error + func (ps *PubSub) Drops() uint64 + func (ps *PubSub) PSubscribe(_ context.Context, patterns ...string) error + func (ps *PubSub) PUnsubscribe(_ context.Context, patterns ...string) error + func (ps *PubSub) SSubscribe(_ context.Context, channels ...string) error + func (ps *PubSub) SUnsubscribe(_ context.Context, channels ...string) error + func (ps *PubSub) Subscribe(_ context.Context, channels ...string) error + func (ps *PubSub) Unsubscribe(_ context.Context, channels ...string) error + type RedisError struct + Msg string + Prefix string + func (e *RedisError) Error() string + func (e *RedisError) Is(target error) bool + type ScanIterator struct + func (it *ScanIterator) Err() error + func (it *ScanIterator) Next(ctx context.Context) (string, bool) + type SentinelClient struct + func NewSentinelClient(cfg SentinelConfig) (*SentinelClient, error) + func (s *SentinelClient) Close() error + func (s *SentinelClient) Decr(ctx context.Context, key string) (int64, error) + func (s *SentinelClient) Del(ctx context.Context, keys ...string) (int64, error) + func (s *SentinelClient) Do(ctx context.Context, args ...any) (*protocol.Value, error) + func (s *SentinelClient) Exists(ctx context.Context, keys ...string) (int64, error) + func (s *SentinelClient) Expire(ctx context.Context, key string, expiration time.Duration) (bool, error) + func (s *SentinelClient) Get(ctx context.Context, key string) (string, error) + func (s *SentinelClient) GetBytes(ctx context.Context, key string) ([]byte, error) + func (s *SentinelClient) HDel(ctx context.Context, key string, fields ...string) (int64, error) + func (s *SentinelClient) HGet(ctx context.Context, key, field string) (string, error) + func (s *SentinelClient) HGetAll(ctx context.Context, key string) (map[string]string, error) + func (s *SentinelClient) HSet(ctx context.Context, key string, values ...any) (int64, error) + func (s *SentinelClient) Incr(ctx context.Context, key string) (int64, error) + func (s *SentinelClient) LPop(ctx context.Context, key string) (string, error) + func (s *SentinelClient) LPush(ctx context.Context, key string, values ...any) (int64, error) + func (s *SentinelClient) LRange(ctx context.Context, key string, start, stop int64) ([]string, error) + func (s *SentinelClient) MGet(ctx context.Context, keys ...string) ([]string, error) + func (s *SentinelClient) MSet(ctx context.Context, pairs ...any) error + func (s *SentinelClient) Ping(ctx context.Context) error + func (s *SentinelClient) Pipeline() *Pipeline + func (s *SentinelClient) Publish(ctx context.Context, channel, message string) (int64, error) + func (s *SentinelClient) RPop(ctx context.Context, key string) (string, error) + func (s *SentinelClient) RPush(ctx context.Context, key string, values ...any) (int64, error) + func (s *SentinelClient) SAdd(ctx context.Context, key string, members ...any) (int64, error) + func (s *SentinelClient) SMembers(ctx context.Context, key string) ([]string, error) + func (s *SentinelClient) Set(ctx context.Context, key string, value any, expiration time.Duration) error + func (s *SentinelClient) SetNX(ctx context.Context, key string, value any, expiration time.Duration) (bool, error) + func (s *SentinelClient) Stats() async.PoolStats + func (s *SentinelClient) Subscribe(ctx context.Context, channels ...string) (*PubSub, error) + func (s *SentinelClient) TTL(ctx context.Context, key string) (time.Duration, error) + func (s *SentinelClient) ZAdd(ctx context.Context, key string, members ...Z) (int64, error) + func (s *SentinelClient) ZRange(ctx context.Context, key string, start, stop int64) ([]string, error) + type SentinelConfig struct + DB int + DialTimeout time.Duration + Engine eventloop.ServerProvider + MasterName string + MaxIdlePerWorker int + Password string + PoolSize int + ReadTimeout time.Duration + SentinelAddrs []string + SentinelPassword string + Username string + WriteTimeout time.Duration + type StatusCmd struct + func (c *StatusCmd) Result() (string, error) + type StringCmd struct + func (c *StringCmd) Result() (string, error) + type Tx struct + func (tx *Tx) Decr(key string) *IntCmd + func (tx *Tx) Del(keys ...string) *IntCmd + func (tx *Tx) Discard() error + func (tx *Tx) Exec(ctx context.Context) error + func (tx *Tx) Exists(keys ...string) *IntCmd + func (tx *Tx) Expire(key string, d time.Duration) *BoolCmd + func (tx *Tx) Get(key string) *StringCmd + func (tx *Tx) HGet(key, field string) *StringCmd + func (tx *Tx) HSet(key string, values ...any) *IntCmd + func (tx *Tx) Incr(key string) *IntCmd + func (tx *Tx) LPush(key string, values ...any) *IntCmd + func (tx *Tx) RPush(key string, values ...any) *IntCmd + func (tx *Tx) SAdd(key string, members ...any) *IntCmd + func (tx *Tx) Set(key string, value any, expiration time.Duration) *StatusCmd + func (tx *Tx) Unwatch(ctx context.Context) error + func (tx *Tx) Watch(ctx context.Context, keys ...string) error + func (tx *Tx) ZAdd(key string, members ...Z) *IntCmd + type Z struct + Member any + Score float64 + type ZRangeBy struct + Count int64 + Max string + Min string + Offset int64