locks

package
v0.0.0-...-c6cbf5f Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyLock

type DummyLock struct {
}

func (DummyLock) TryLock

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

func (DummyLock) Unlock

func (l DummyLock) Unlock()

type Lock

type Lock interface {
	// TryLock Attempts to acquire lock within given amount of time. If lock is not free by
	// that time, returns false. Otherwise, returns true
	TryLock(timeout time.Duration) (bool, error)
	Unlock()
}

Lock all operations with lock

type LockFactory

type LockFactory interface {
	CreateLock(name string) Lock
}

LockFactory creates lock and returns it (without locking)

Jump to

Keyboard shortcuts

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