Versions in this module Expand all Collapse all v0 v0.2.1 Oct 9, 2026 v0.2.0 Oct 8, 2026 Changes in this version + const AuthIAM + const AuthPassword + var ErrCrossSlot = errors.New("celerity: keys are not on one shard") + var ErrNotFound = errors.New("celerity: not found") + type Client interface + type Connection struct + AuthMode string + ClusterMode bool + Host string + KeyPrefix string + Password func(context.Context) (string, error) + Port int + TLS bool + User string + type Connector interface + Connection func(ctx context.Context) (Connection, error) + type Counters interface + Decrement func(ctx context.Context, key string, delta int64) (int64, error) + Increment func(ctx context.Context, key string, delta int64) (int64, error) + IncrementFloat func(ctx context.Context, key string, delta float64) (float64, error) + type End string + const Left + const Right + func ResolveEndOptions(opts []EndOption, fallback End) End + type EndOption func(*EndOptions) + func AtLeft() EndOption + func AtRight() EndOption + type EndOptions struct + End End + type Hashes interface + HashDelete func(ctx context.Context, key string, fields []string) (int64, error) + HashExists func(ctx context.Context, key, field string) (bool, error) + HashGet func(ctx context.Context, key, field string) (string, error) + HashGetAll func(ctx context.Context, key string) (map[string]string, error) + HashIncrement func(ctx context.Context, key, field string, delta int64) (int64, error) + HashKeys func(ctx context.Context, key string) ([]string, error) + HashLen func(ctx context.Context, key string) (int64, error) + HashSet func(ctx context.Context, key string, fields map[string]string) error + type KeyType string + const KeyHash + const KeyList + const KeySet + const KeySortedSet + const KeyString + type Keys interface + Exists func(ctx context.Context, key string) (bool, error) + Expire func(ctx context.Context, key string, ttl time.Duration) (bool, error) + Persist func(ctx context.Context, key string) (bool, error) + Rename func(ctx context.Context, key, newKey string) error + Scan func(ctx context.Context, opts ...ScanOption) iter.Seq2[string, error] + TTL func(ctx context.Context, key string) (ttl time.Duration, expires bool, err error) + Type func(ctx context.Context, key string) (KeyType, error) + type Lists interface + ListIndex func(ctx context.Context, key string, index int64) (string, error) + ListLen func(ctx context.Context, key string) (int64, error) + ListPop func(ctx context.Context, key string, count int64, opts ...EndOption) ([]string, error) + ListPush func(ctx context.Context, key string, values []string, opts ...EndOption) (int64, error) + ListRange func(ctx context.Context, key string, start, stop int64) ([]string, error) + ListTrim func(ctx context.Context, key string, start, stop int64) error + type RangeOption func(*RangeOptions) + func Descending() RangeOption + func Page(offset, limit int64) RangeOption + type RangeOptions struct + Descending bool + Limit int64 + Offset int64 + func ResolveRangeOptions(opts []RangeOption) RangeOptions + type ScanOption func(*ScanOptions) + func Holding(kind KeyType) ScanOption + func Matching(pattern string) ScanOption + func PerRoundTrip(count int64) ScanOption + type ScanOptions struct + Count int64 + Match string + Type KeyType + func ResolveScanOptions(opts []ScanOption) ScanOptions + type ScoreRange struct + Max *float64 + Min *float64 + func AllScores() ScoreRange + func Scores(low, high float64) ScoreRange + func ScoresFrom(low float64) ScoreRange + func ScoresUpTo(high float64) ScoreRange + type SetOption func(*SetOptions) + func Expires(ttl time.Duration) SetOption + func IfExists() SetOption + func IfNotExists() SetOption + type SetOptions struct + OnlyIfAbsent bool + OnlyIfPresent bool + TTL time.Duration + func ResolveSetOptions(opts []SetOption) SetOptions + type Sets interface + SetAdd func(ctx context.Context, key string, members []string) (int64, error) + SetDiff func(ctx context.Context, keys []string) ([]string, error) + SetIntersect func(ctx context.Context, keys []string) ([]string, error) + SetIsMember func(ctx context.Context, key, member string) (bool, error) + SetLen func(ctx context.Context, key string) (int64, error) + SetMembers func(ctx context.Context, key string) ([]string, error) + SetRemove func(ctx context.Context, key string, members []string) (int64, error) + SetUnion func(ctx context.Context, keys []string) ([]string, error) + type SortedSetMember struct + Member string + Score float64 + type SortedSets interface + SortedSetAdd func(ctx context.Context, key string, members []SortedSetMember) (int64, error) + SortedSetCountByScore func(ctx context.Context, key string, scores ScoreRange) (int64, error) + SortedSetIncrement func(ctx context.Context, key, member string, delta float64) (float64, error) + SortedSetLen func(ctx context.Context, key string) (int64, error) + SortedSetRange func(ctx context.Context, key string, start, stop int64, opts ...RangeOption) ([]SortedSetMember, error) + SortedSetRangeByScore func(ctx context.Context, key string, scores ScoreRange, opts ...RangeOption) ([]SortedSetMember, error) + SortedSetRank func(ctx context.Context, key, member string, opts ...RangeOption) (int64, error) + SortedSetRemove func(ctx context.Context, key string, members []string) (int64, error) + SortedSetRemoveByRank func(ctx context.Context, key string, start, stop int64) (int64, error) + SortedSetRemoveByScore func(ctx context.Context, key string, scores ScoreRange) (int64, error) + SortedSetScore func(ctx context.Context, key, member string) (float64, error) + type Strings interface + Append func(ctx context.Context, key, value string) (int64, error) + Delete func(ctx context.Context, key string) (bool, error) + DeleteMany func(ctx context.Context, keys []string) (int64, error) + Get func(ctx context.Context, key string) (string, error) + GetMany func(ctx context.Context, keys []string) (map[string]string, error) + GetSet func(ctx context.Context, key, value string) (string, error) + Set func(ctx context.Context, key, value string, opts ...SetOption) (bool, error) + SetMany func(ctx context.Context, values map[string]string) error + type Transactor interface + Transaction func(ctx context.Context, queue func(Tx)) ([]any, error) + type Tx interface + Append func(key, value string) Tx + Decrement func(key string, delta int64) Tx + Delete func(key string) Tx + Expire func(key string, ttl time.Duration) Tx + GetSet func(key, value string) Tx + HashDelete func(key string, fields []string) Tx + HashIncrement func(key, field string, delta int64) Tx + HashSet func(key string, fields map[string]string) Tx + Increment func(key string, delta int64) Tx + IncrementFloat func(key string, delta float64) Tx + ListPush func(key string, values []string, opts ...EndOption) Tx + ListTrim func(key string, start, stop int64) Tx + Persist func(key string) Tx + Rename func(key, newKey string) Tx + Set func(key, value string, opts ...SetOption) Tx + SetAdd func(key string, members []string) Tx + SetRemove func(key string, members []string) Tx + SortedSetAdd func(key string, members []SortedSetMember) Tx + SortedSetIncrement func(key, member string, delta float64) Tx + SortedSetRemove func(key string, members []string) Tx