memory

package
v0.296.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: Apache-2.0 Imports: 4 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 a memory-based implementation of guard.Lock. Lock is not safe to call from different application instances. Lock is meant to be used in a single application instance.

func NewLocker

func NewLocker() *Lock

func (*Lock) Lock

func (l *Lock) Lock(ctx context.Context) (context.Context, error)

func (*Lock) TryLock

func (l *Lock) TryLock(ctx context.Context) (context.Context, bool, error)

func (*Lock) Unlock

func (l *Lock) Unlock(ctx context.Context) error

type LockerFactory

type LockerFactory[Key comparable] struct {
	// contains filtered or unexported fields
}

func NewLockerFactory

func NewLockerFactory[Key comparable]() *LockerFactory[Key]

func (*LockerFactory[Key]) LockerFor

func (lf *LockerFactory[Key]) LockerFor(key Key) guard.Locker

func (*LockerFactory[Key]) NonBlockingLockerFor

func (lf *LockerFactory[Key]) NonBlockingLockerFor(key Key) guard.NonBlockingLocker

Jump to

Keyboard shortcuts

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