locker

package
v0.1.149 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LOCKER_INMEMORY = "inmemory"
	LOCKER_POSTGRES = "postgres"
)

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) AcquireLock

func (m *InMemoryLocker) AcquireLock(ctx context.Context, key string) (Lock, error)

type Lock

type Lock interface {
	ReleaseLock(ctx context.Context) error
}

type Locker

type Locker interface {
	AcquireLock(ctx context.Context, key string) (Lock, error)
}

type PostgresLocker

type PostgresLocker struct {
	// contains filtered or unexported fields
}

func NewPostgresLocker

func NewPostgresLocker(dsn string) (*PostgresLocker, error)

func (*PostgresLocker) AcquireLock

func (p *PostgresLocker) AcquireLock(ctx context.Context, key string) (Lock, error)

Jump to

Keyboard shortcuts

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