Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDistributedMutexBuilderFunc ¶
func NewDistributedMutexBuilderFunc(etcdclient *etcdclient.Client) func(string) (DistributedMutex, error)
Types ¶
type DistributedMutex ¶
type DistributedMutex interface { Key() string Lock(ctx context.Context) error TryLock(ctx context.Context) error Unlock(ctx context.Context) error }
func NewDistributedMutex ¶
func NewDistributedMutex(etcdclient *etcdclient.Client, pfx string) (DistributedMutex, error)
type MutexStore ¶
type MutexStore struct {
// contains filtered or unexported fields
}
MutexStore allows reuse of the same dist mutex in Etcd for a given key.
func NewMutexStore ¶
func NewMutexStore(mutexBuilderFunc func(string) (DistributedMutex, error), collector collector.Collector) *MutexStore
func (*MutexStore) Delete ¶
func (m *MutexStore) Delete(keys ...string)
func (*MutexStore) Get ¶
func (m *MutexStore) Get(key string) (DistributedMutex, error)
type Mutexer ¶
type Mutexer struct {
// contains filtered or unexported fields
}
Mutexer locks and unlocks mutexes locally based on key, with garbage collection method.
func NewMutexer ¶
Click to show internal directories.
Click to hide internal directories.