disk

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 12, 2016 License: Apache-2.0 Imports: 5 Imported by: 28 modules, 25 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLock

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

FileLock wraps os.File to be used as a lock using flock

func NewFileLock

func NewFileLock(path string) (*FileLock, error)

NewFileLock opens file/dir at path and returns unlocked FileLock object

func (*FileLock) Close

func (l *FileLock) Close() error

Close closes underlying file

func (*FileLock) Lock

func (l *FileLock) Lock() error

Lock acquires an exclusive lock

func (*FileLock) Unlock

func (l *FileLock) Unlock() error

Unlock releases the lock

type Store

type Store struct {
	FileLock
	// contains filtered or unexported fields
}

func New

func New(network string) (*Store, error)

func (*Store) Release

func (s *Store) Release(ip net.IP) error

func (*Store) ReleaseByID

func (s *Store) ReleaseByID(id string) error

N.B. This function eats errors to be tolerant and release as much as possible

func (*Store) Reserve

func (s *Store) Reserve(id string, ip net.IP) (bool, error)

Jump to

Keyboard shortcuts

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