lock

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLockDir

func CreateLockDir() (string, error)

Types

type Lock

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

func CreateLock

func CreateLock() (Lock, error)

func (*Lock) CreateFile

func (lock *Lock) CreateFile(folderName string, pid int) error

func (*Lock) CreateNewLockFile

func (lock *Lock) CreateNewLockFile() error

Creating a new lock object.

func (*Lock) Lock

func (lock *Lock) Lock() error

Try to acquire a lock

func (*Lock) Unlock

func (lock *Lock) Unlock() error

Removes the lock file so other process can continue.

type Locks

type Locks []Lock

func (Locks) Len

func (locks Locks) Len() int

func (Locks) Less

func (locks Locks) Less(i, j int) bool

func (Locks) Swap

func (locks Locks) Swap(i, j int)

Jump to

Keyboard shortcuts

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