flock

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package flock implements a simple POSIX file-based advisory lock.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T

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

func New

func New(path string) *T

New creates an object that locks the given path.

func (*T) Lock

func (f *T) Lock(ctx context.Context) (err error)

Lock locks the file. Iff Lock() returns nil, the caller must call Unlock() later.

func (*T) Unlock

func (f *T) Unlock() error

Unlock unlocks the file.

Jump to

Keyboard shortcuts

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