inmemory

package
v0.0.0-...-9c552bb Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lock

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

Lock is an in-memory lock

func (*Lock) TryLock

func (l *Lock) TryLock(timeout time.Duration) (bool, error)

TryLock Attempts to acquire lock within given amount of time. If lock is not free by that time, returns false. Otherwise, returns true

func (*Lock) Unlock

func (l *Lock) Unlock()

Unlock unlocks the key

type LockFactory

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

LockFactory is an in-memory based LockFactory

func NewLockFactory

func NewLockFactory() (*LockFactory, io.Closer)

NewLockFactory returns configured Redis based LockFactory

func (*LockFactory) CreateLock

func (lf *LockFactory) CreateLock(name string) locks.Lock

CreateLock returns lock instance (not yet locked)

Jump to

Keyboard shortcuts

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