backend

package
v0.2.2-rc9 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 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 {
	*filemutex.FileMutex
}

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

func NewFileLock

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

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

type Store

type Store interface {
	Lock() error
	Unlock() error
	Reserve(ns string, port int) (bool, error)
	Release(ns string, port int) error
	LastReserved(ns string) (int, error)
	GetByNS(ns string) ([]int, error)
	Close() error
}

Store define the interface to implement to be used as a backend for a port Allocator

func NewFSStore

func NewFSStore(root string) (Store, error)

NewFSStore creates a backend for port manager that stores the allocated port in a filesystem

Jump to

Keyboard shortcuts

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