Documentation ¶
Index ¶
- Variables
- func CIDRToIP(array []string) []string
- func CheckIfSameNetwork(cidr1 string, cidr2 string) bool
- func DiscoverPeers() error
- func IsInPrivateRange(cidr string) bool
- func NodeAppend(nodeList dockercloud.NodeListResponse) ([]string, []string)
- func PostInterfaceData(url string)
- func Send(url string, data []byte)
- type NodeNetwork
- type PostForm
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 CheckIfSameNetwork ¶
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 ¶
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
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
Click to show internal directories.
Click to hide internal directories.