nodes

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//NodeAPIURI resource uri of the current node
	NodeAPIURI = os.Getenv("DOCKERCLOUD_NODE_API_URI")
	//NodePublicIP public IP of the current node
	NodePublicIP = ""
	//NodeCIDR private IPs of the current node
	NodeCIDR = []dockercloud.Network{}
	//NodeUUID UUID of the current node
	NodeUUID = ""
	//Region region of the current node
	Region = ""
)

Functions

func CIDRToIP

func CIDRToIP(array []string) []string

CIDRToIP converts array of CIDRs to array of IPs

func CheckIfSameNetwork

func CheckIfSameNetwork(cidr1 string, cidr2 string) bool

CheckIfSameNetwork returns true if one of the CIDR contains the other, otherwise returns false

func DiscoverPeers

func DiscoverPeers() error

DiscoverPeers queries DockerCloud API for the list of nodes and checks if nodes must be attached or forgotten

func IsInPrivateRange

func IsInPrivateRange(cidr string) bool

IsInPrivateRange check if the requested CIDR is in the private IP range

func NodeAppend

func NodeAppend(nodeList dockercloud.NodeListResponse) ([]string, []string)

NodeAppend returns the list of Public and Private IPs

func PostInterfaceData

func PostInterfaceData(url string)

PostInterfaceData triggers Send function

func Send

func Send(url string, data []byte)

Send sends PATCH request on the database to update the current node with its private IPs

Types

type NodeNetwork

type NodeNetwork struct {
	PublicIP string
	// contains filtered or unexported fields
}

NodeNetwork type

type PostForm

type PostForm struct {
	Interfaces []dockercloud.Network `json:"private_ips"`
}

PostForm type contains the interfaces of the current node to be PATCHed

Jump to

Keyboard shortcuts

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