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.

          Source Files