Documentation
¶
Overview ¶
Package locker provides functions for distributed locking.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnexpectedRedisResponse = errors.New("locker: unexpected redis response")
ErrUnexpectedRedisResponse is the error returned when Redis command returns response of unexpected type.
Functions ¶
This section is empty.
Types ¶
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
Lock implements distributed locking.
type LockResult ¶ added in v0.3.0
LockResult contains new lock and result of applying a lock.
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker defines parameters for creating new lock.
type RedisClient ¶ added in v0.2.0
type RedisClient interface { Eval(ctx context.Context, script string, keys []string, args ...interface{}) *redis.Cmd EvalSha(ctx context.Context, sha1 string, keys []string, args ...interface{}) *redis.Cmd ScriptExists(ctx context.Context, hashes ...string) *redis.BoolSliceCmd ScriptLoad(ctx context.Context, script string) *redis.StringCmd }
RedisClient is redis scripter interface.
Click to show internal directories.
Click to hide internal directories.