Documentation ¶
Index ¶
Constants ¶
View Source
const (
ErrAlreadyLocked = "Already locked"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryLocker ¶
type InMemoryLocker struct {
// contains filtered or unexported fields
}
func NewInMemoryLocker ¶
func NewInMemoryLocker() *InMemoryLocker
func (*InMemoryLocker) Close ¶
func (iml *InMemoryLocker) Close()
func (*InMemoryLocker) Done ¶
func (iml *InMemoryLocker) Done(ctx context.Context, session LockSession)
func (*InMemoryLocker) Obtain ¶
func (iml *InMemoryLocker) Obtain(ctx context.Context, req ctrl.Request) LockSession
type LockSession ¶
type LockSession struct {
// contains filtered or unexported fields
}
func (*LockSession) AlreadyLocked ¶
func (ls *LockSession) AlreadyLocked() bool
func (*LockSession) GetError ¶
func (ls *LockSession) GetError() error
func (*LockSession) HasFailure ¶
func (ls *LockSession) HasFailure() bool
type Locker ¶
type Locker interface { Obtain(ctx context.Context, req ctrl.Request) LockSession Done(ctx context.Context, session LockSession) Close() }
type RedisDistributedLocker ¶
type RedisDistributedLocker struct {
// contains filtered or unexported fields
}
func NewRedisDistributedLocker ¶
func NewRedisDistributedLocker(proto string, host string, port int) *RedisDistributedLocker
func (*RedisDistributedLocker) Close ¶
func (rdl *RedisDistributedLocker) Close()
func (*RedisDistributedLocker) Done ¶
func (rdl *RedisDistributedLocker) Done(ctx context.Context, session LockSession)
func (*RedisDistributedLocker) Obtain ¶
func (rdl *RedisDistributedLocker) Obtain(ctx context.Context, req ctrl.Request) LockSession
Click to show internal directories.
Click to hide internal directories.