pathlock

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package pathlock defines a PathLocker interface and an implementation that will synchronize based on filepath.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locker

type Locker interface {
	Lock(path string) (Unlocker, error)
}

Locker is an interface for synchronizing on a given filepath. A call to Lock a given path will block any asynchronous calls to Lock that same path, or any parent or child path in the same sub-tree. For example:

  • Lock path /a/b/c
  • Blocks a Lock call for the same path /a/b/c
  • Blocks a Lock call for path /a/b or /a
  • Blocks a Lock call for path /a/b/c/d
  • Allows a Lock call for path /a/b/x
  • Allows a Lock call for path /a/x

func NewLocker

func NewLocker() Locker

NewLocker returns a Locker.

type Unlocker

type Unlocker interface {
	Unlock()
}

Unlocker unlocks from a previous invocation of Lock().

Jump to

Keyboard shortcuts

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