etcd

package
v0.0.0-...-9ec97d0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ETCDPrefix string = "/etcd-macvlan-cni/networks"

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	EtcdClient    *clientv3.Client
	EtcdKeyPrefix string
	// 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 New

func New(name string, ipamConfig *allocator.IPAMConfig) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) LastReservedIP

func (s *Store) LastReservedIP(rangeID string) (net.IP, error)

LastReservedIP returns the last reserved IP if exists

func (*Store) Lock

func (s *Store) Lock() 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, rangeID string) (bool, error)

func (*Store) Unlock

func (s *Store) Unlock() error

Jump to

Keyboard shortcuts

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