Back to godoc.org

Package flock

v0.0.9
Latest Go to latest
Published: Jun 24, 2020 | License: Apache-2.0 | Module: github.com/grailbio/base

Overview

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

Index

Package Files

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.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier