package disk
import "github.com/containernetworking/cni/plugins/ipam/host-local/backend/disk"
Index ¶
- type FileLock
- func NewFileLock(path string) (*FileLock, error)
- func (l *FileLock) Close() error
- func (l *FileLock) Lock() error
- func (l *FileLock) Unlock() error
- type Store
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
func (*FileLock) Close ¶
Close closes underlying file
func (*FileLock) Lock ¶
Lock acquires an exclusive lock
func (*FileLock) Unlock ¶
Unlock releases the lock
type Store ¶
type Store struct { FileLock // contains filtered or unexported fields }
func New ¶
func (*Store) LastReservedIP ¶
LastReservedIP returns the last reserved IP if exists
func (*Store) Release ¶
func (*Store) ReleaseByID ¶
N.B. This function eats errors to be tolerant and release as much as possible
func (*Store) Reserve ¶
Source Files ¶
- Version
- v0.5.0
- Published
- Mar 6, 2017
- Platform
- js/wasm
- Imports
- 7 packages
- Last checked
- 17 hours ago –
Tools for package owners.