Documentation
¶
Overview ¶
Package lock provides named distributed-lock contracts with an in-memory locker; Redis and SQL backends are available via integrations.
Index ¶
Constants ¶
View Source
const ServiceLocker = "service.lock.locker"
Variables ¶
This section is empty.
Functions ¶
func LockerMustFromContainer ¶
func LockerMustFromContainer(serviceContainer containercontract.Container) lockcontract.Locker
func LockerMustFromResolver ¶
func LockerMustFromResolver(resolver containercontract.Resolver) lockcontract.Locker
Types ¶
type InMemoryLocker ¶
type InMemoryLocker struct {
// contains filtered or unexported fields
}
func NewInMemoryLocker ¶
func NewInMemoryLocker(clockInstance clockcontract.Clock) *InMemoryLocker
func (*InMemoryLocker) CreateLock ¶
func (instance *InMemoryLocker) CreateLock(name string, ttl time.Duration) lockcontract.Lock
func (*InMemoryLocker) PurgeExpired ¶
func (instance *InMemoryLocker) PurgeExpired() int
Click to show internal directories.
Click to hide internal directories.