Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFailed = errors.New("memsync: failed to acquire lock")
Functions ¶
This section is empty.
Types ¶
type Memsync ¶
type Memsync struct {
// contains filtered or unexported fields
}
Memsync provides a simple method for creating distributed mutexes using memcache.
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
A Mutex is a distributed mutual exclusion lock.
type Option ¶
type Option func(*Mutex)
Option confibures a mutex.
func WithDriftFactor ¶
WithDriftFactor can be used to set the clock drift factor.
func WithExpiry ¶
WithExpiry can be used to set the expiry of mutex to the given token.
func WithGenTokenFunc ¶
WithGenTokenFunc can be used to set custom value generator.
func WithRetryDelay ¶
WithRetryDelay can be used to set the amount of time to wait between retries.
func WithRetryDelayFunc ¶
WithRetryDelayFunc can be used to override default delay behavior.
Click to show internal directories.
Click to hide internal directories.