consul

package
v0.0.0-...-2708aaf Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectStore

func ConnectStore(Addr string, Port string, DC string) (consul *api.Client, err error)

func GetKV

func GetKV(k string, kv *api.KV) (list api.KVPairs, err error)

func InitStore

func InitStore(k string, network []byte, consul *api.Client) (store string, err error)

func LeaseJson

func LeaseJson(ip net.IP, id string) (conf []byte, err error)

func NetConfigJson

func NetConfigJson(n *allocator.IPAMConfig) (config []byte, err error)

func PutKV

func PutKV(k string, val []byte, kv *api.KV) (k_store string, err error)

Types

type IP_Settings

type IP_Settings struct {
	Gw     net.IP        `json:"gw"`
	Net    types.IPNet   `json:"net"`
	Start  net.IP        `json:"start"`
	End    net.IP        `json:"end"`
	Routes []types.Route `json:"routes"`
}

type Lease

type Lease struct {
	IP  net.IP `json:"ip"`
	MAC string `json:"mac"`
	ID  string `json:"id"`
}

type Store

type Store struct {
	Consul *api.Client
	Key    string
}

func New

func New(n *allocator.IPAMConfig) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

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

func (*Store) Reserve

func (s *Store) Reserve(id string, ip net.IP) (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