Documentation
¶
Index ¶
- type MemoryBackend
- func (m *MemoryBackend) Close() error
- func (m *MemoryBackend) GetLocks(group string) (int, error)
- func (m *MemoryBackend) GetStaleLocks(ts time.Duration) ([]types.Lock, error)
- func (m *MemoryBackend) HasLock(group, id string) (bool, error)
- func (m *MemoryBackend) Release(group string, id string) error
- func (m *MemoryBackend) Reserve(group string, id string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryBackend ¶
type MemoryBackend struct {
// contains filtered or unexported fields
}
func NewMemoryBackend ¶
func NewMemoryBackend(groups []string) *MemoryBackend
func (*MemoryBackend) Close ¶
func (m *MemoryBackend) Close() error
Calls all necessary finalization if necessary
func (*MemoryBackend) GetLocks ¶
func (m *MemoryBackend) GetLocks(group string) (int, error)
Returns the current number of locks for the given group
func (*MemoryBackend) GetStaleLocks ¶
Return all locks older than x
func (*MemoryBackend) HasLock ¶
func (m *MemoryBackend) HasLock(group, id string) (bool, error)
Check if a given id already has a lock for this group
Click to show internal directories.
Click to hide internal directories.