memory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package memory provides a process-local lock (useful for tests / single instance).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager creates memory locks keyed by string.

func NewManager

func NewManager() *Manager

NewManager creates a memory lock manager.

func (*Manager) NewMutex

func (m *Manager) NewMutex(key string, opts ...lock.Option) (lock.Locker, error)

NewMutex returns a Locker for key.

type Mutex

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

Mutex is a process-local lock.

func (*Mutex) Lock

func (m *Mutex) Lock(ctx context.Context) error

func (*Mutex) Refresh

func (m *Mutex) Refresh(ctx context.Context) error

func (*Mutex) TryLock

func (m *Mutex) TryLock(ctx context.Context) error

func (*Mutex) Unlock

func (m *Mutex) Unlock(ctx context.Context) error

Jump to

Keyboard shortcuts

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