api

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

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

Go to latest
Published: Feb 26, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WeaveHTTPHost = "127.0.0.1"
	WeaveHTTPPort = 6784
)
View Source
const NoContainerID string = "_"

Special token used in place of a container identifier when: - the caller does not know the container ID, or - the caller is unsure whether IPAM was previously told the container ID.

While addresses are typically stored under their container IDs, when this token is used, the address will be stored under its own string, something which should be kept in mind if the entry needs to be removed at any point.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(addr string, log Logger) *Client

func (*Client) AllocateIP

func (client *Client) AllocateIP(ID string, checkAlive bool) (*net.IPNet, error)

returns an IP for the ID given, allocating a fresh one if necessary

func (*Client) AllocateIPInSubnet

func (client *Client) AllocateIPInSubnet(ID string, subnet *net.IPNet, checkAlive bool) (*net.IPNet, error)

func (*Client) ClaimIP

func (client *Client) ClaimIP(ID string, cidr *net.IPNet, checkAlive bool) error

Claim a specific IP on behalf of the ID

func (*Client) Connect

func (client *Client) Connect(remote string) error

func (*Client) DNSDomain

func (client *Client) DNSDomain() (string, error)

func (*Client) DefaultSubnet

func (client *Client) DefaultSubnet() (*net.IPNet, error)

func (*Client) DeregisterWithDNS

func (client *Client) DeregisterWithDNS(ID string, ip string) error

func (*Client) Expose

func (client *Client) Expose(ipAddr *net.IPNet) error

Expose calls the router to assign the given IP addr to the weave bridge.

func (*Client) IsReady

func (client *Client) IsReady() bool

IsReady returns true if the API server is up and running (note it returns StatusServiceUnavailable until all parts are ready, but callers of this function are expected to be ok with a partial service)

func (*Client) LookupIP

func (client *Client) LookupIP(ID string) (*net.IPNet, error)

returns an IP for the ID given, or nil if one has not been allocated

func (*Client) RegisterWithDNS

func (client *Client) RegisterWithDNS(ID string, fqdn string, ip string) error

func (*Client) ReleaseIPsFor

func (client *Client) ReleaseIPsFor(ID string) error

release all IPs owned by an ID

func (*Client) ReplacePeers

func (client *Client) ReplacePeers(peers []string) error

ReplacePeers replace the current set of peers

func (*Client) RmPeer

func (client *Client) RmPeer(peerName string) (string, error)

release all IP space owned by a peer

func (*Client) WaitAPIServer

func (client *Client) WaitAPIServer(n int)

WaitAPIServer waits until the API server is ready to serve.

type Logger

type Logger interface {
	Infof(string, ...interface{})
	Debugf(string, ...interface{})
}

Jump to

Keyboard shortcuts

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