backend

package
v0.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

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