Documentation ¶
Index ¶
- Constants
- func GetEscapedPath(dataDir string, fname string) string
- type FileLock
- type Store
- func (s *Store) FindByID(id string, ifname string) bool
- func (s *Store) FindByKey(match string) (bool, error)
- func (s *Store) GetByID(id string, ifname string) []net.IP
- func (s *Store) LastReservedIP(rangeID string) (net.IP, error)
- func (s *Store) ReleaseByID(id string, ifname string) error
- func (s *Store) ReleaseByKey(match string) (bool, error)
- func (s *Store) Reserve(id string, ifname string, ip net.IP, rangeID string) (bool, error)
Constants ¶
View Source
const (
LineBreak = "\r\n"
)
Variables ¶
This section is empty.
Functions ¶
func GetEscapedPath ¶ added in v0.7.0
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 ¶
NewFileLock opens file/dir at path and returns unlocked FileLock object
type Store ¶
type Store struct { *FileLock // contains filtered or unexported fields }
Store is a simple disk-backed store that creates one file per IP address in a given directory. The contents of the file are the container ID.
func (*Store) GetByID ¶ added in v0.8.2
GetByID returns the IPs which have been allocated to the specific ID
func (*Store) LastReservedIP ¶ added in v0.6.0
LastReservedIP returns the last reserved IP if exists
func (*Store) ReleaseByID ¶
N.B. This function eats errors to be tolerant and release as much as possible
func (*Store) ReleaseByKey ¶ added in v0.8.0
Click to show internal directories.
Click to hide internal directories.