base: Index | Files

package flock

import ""

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


Package Files


type T Uses

type T struct {
    // contains filtered or unexported fields

func New Uses

func New(path string) *T

New creates an object that locks the given path.

func (*T) Lock Uses

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 Uses

func (f *T) Unlock() error

Unlock unlocks the file.

Package flock imports 4 packages (graph) and is imported by 1 packages. Updated 2019-07-22. Refresh now. Tools for package owners.