Documentation
¶
Overview ¶
Package cluster provides a sorted-set API (via Redis ZSETs) on top of a group of Redis instances.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
Cluster defines methods that efficiently provide ZSET semantics on a cluster.
func New ¶
func New(pool *pool.Pool, maxSize int, instr instrumentation.Instrumentation) Cluster
New creates and returns a new Cluster backed by a concrete Redis cluster. maxSize for each key will be enforced at write time. Instrumentation may be nil.
type Deleter ¶
type Deleter interface {
Delete(tuples []common.KeyScoreMember) error
}
Deleter defines the method to delete elements from a sorted set. A key- member's score must be larger than the currently stored score for the delete to be accepted. A non-nil error indicates only physical problems, not logical.
type Element ¶
type Element struct { Key string KeyScoreMembers []common.KeyScoreMember Error error }
Element combines a submitted key with its selected score-members. If there was an error while selecting a key, the error field will be populated, and common.KeyScoreMembers may be empty. TODO rename.
type Inserter ¶
type Inserter interface {
Insert(tuples []common.KeyScoreMember) error
}
Inserter defines the method to add elements to a sorted set. A key-member's score must be larger than the currently stored score for the insert to be accepted. A non-nil error indicates only physical problems, not logical.
type Scanner ¶ added in v0.0.2
Scanner emits all keys in the keyspace over a returned channel. When the keys are exhaused, the channel is closed. The order in which keys are emitted is unpredictable. Scanning is performed one Redis instance at a time in random order of the instances. If an instance is down at the time it is tried to be scanned, it is skipped (no retries). See also implications of the Redis SCAN command. Note that keys for which only deletes have happened (and no inserts) will not be emitted.