lock

package
v3.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 10 Imported by: 0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL