lock

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLockExists = errors.New("lock already acquired")

Functions

This section is empty.

Types

type Lock

type Lock interface {
	GetID() int64
	GetAcquiredAt() time.Time
}

type Repository

type Repository interface {
	Acquire(ctx context.Context, id int64, worker WorkerFn) (Lock, error)
}

func New

func New(db *sqlx.DB) Repository

type WorkerFn

type WorkerFn func()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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