locking

package
v0.0.0-...-3442565 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FSContentLock

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

func NewFSContentLock

func NewFSContentLock(p string) (*FSContentLock, error)

func (*FSContentLock) Acquire

func (l *FSContentLock) Acquire(ctx context.Context, id string) (LockGuard, error)

type FSContentLockGuard

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

func (*FSContentLockGuard) Release

func (l *FSContentLockGuard) Release() error

type FSFlockLock

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

func NewFSFlockLock

func NewFSFlockLock(p string) (*FSFlockLock, error)

func (*FSFlockLock) Acquire

func (l *FSFlockLock) Acquire(ctx context.Context, id string) (LockGuard, error)

type FSFlockLockGuard

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

func (*FSFlockLockGuard) Release

func (l *FSFlockLockGuard) Release() error

type Lock

type Lock interface {
	Acquire(ctx context.Context, id string) (LockGuard, error)
}

Lock is the interface for a mutex

type LockGuard

type LockGuard interface {
	Release() error
}

LockGuard is a lock that is actually held

type LockInfo

type LockInfo struct {
	Holder    string `json:"owner"`
	Timestamp int64  `json:"timestamp"`
}

func (*LockInfo) String

func (l *LockInfo) String() string

String implements Stringer

func (*LockInfo) ToJSON

func (l *LockInfo) ToJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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