memory

package
v2.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locker

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

func NewLocker

func NewLocker(seconds time.Duration, opts ...Option) *Locker

func (*Locker) ForceRelease

func (m *Locker) ForceRelease(context.Context) error

func (*Locker) LockedOwner

func (m *Locker) LockedOwner(context.Context) (string, error)

func (*Locker) Owner

func (m *Locker) Owner() string

func (*Locker) Release

func (m *Locker) Release(context.Context) (bool, error)

func (*Locker) Try

func (m *Locker) Try(ctx context.Context, fn func() error) error

func (*Locker) Until

func (m *Locker) Until(ctx context.Context, timeout time.Duration, fn func() error) error

type Option

type Option func(*Locker)

func WithOwner

func WithOwner(owner string) Option

func WithSleep

func WithSleep(sleep time.Duration) Option

Jump to

Keyboard shortcuts

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