api

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2015 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType string
const (
	Added   EventType = "ADDED"
	Deleted EventType = "DELETED"
)

type NamespaceEvent

type NamespaceEvent struct {
	Type EventType
	Name string
}

type NetNamespace

type NetNamespace struct {
	Name  string
	NetID uint
}

type NetNamespaceEvent

type NetNamespaceEvent struct {
	Type  EventType
	Name  string
	NetID uint
}

type Node added in v1.0.6

type Node struct {
	Name string
	IP   string
}

type NodeEvent

type NodeEvent struct {
	Type EventType
	Node Node
}

type Service added in v1.0.6

type Service struct {
	Name      string
	Namespace string
	IP        string
	Protocol  ServiceProtocol
	Port      uint
}

type ServiceEvent added in v1.0.6

type ServiceEvent struct {
	Type    EventType
	Service Service
}

type ServiceProtocol added in v1.0.6

type ServiceProtocol string
const (
	TCP ServiceProtocol = "TCP"
	UDP ServiceProtocol = "UDP"
)

type Subnet

type Subnet struct {
	NodeIP   string
	SubnetIP string
}

type SubnetEvent

type SubnetEvent struct {
	Type     EventType
	NodeName string
	Subnet   Subnet
}

type SubnetRegistry

type SubnetRegistry interface {
	InitSubnets() error
	GetSubnets() ([]Subnet, error)
	GetSubnet(nodeName string) (*Subnet, error)
	DeleteSubnet(nodeName string) error
	CreateSubnet(sn string, sub *Subnet) error
	WatchSubnets(receiver chan *SubnetEvent, stop chan bool) error

	InitNodes() error
	GetNodes() ([]Node, error)
	CreateNode(nodeName string, data string) error
	WatchNodes(receiver chan *NodeEvent, stop chan bool) error

	WriteNetworkConfig(network string, subnetLength uint, serviceNetwork string) error
	GetContainerNetwork() (string, error)
	GetSubnetLength() (uint64, error)
	CheckEtcdIsAlive(seconds uint64) bool

	GetNamespaces() ([]string, error)
	WatchNamespaces(receiver chan *NamespaceEvent, stop chan bool) error

	WatchNetNamespaces(receiver chan *NetNamespaceEvent, stop chan bool) error
	GetNetNamespaces() ([]NetNamespace, error)
	GetNetNamespace(name string) (NetNamespace, error)
	WriteNetNamespace(name string, id uint) error
	DeleteNetNamespace(name string) error

	GetServicesNetwork() (string, error)
	GetServices() ([]Service, error)
	WatchServices(receiver chan *ServiceEvent, stop chan bool) error
}

Jump to

Keyboard shortcuts

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