Documentation ¶
Index ¶
- Constants
- type Edge
- type Endpoint
- func (e *Endpoint) Connected(n int) bool
- func (e *Endpoint) Data() map[string]string
- func (e *Endpoint) HasEdge(edge *Edge) bool
- func (e *Endpoint) ID() int
- func (e *Endpoint) Match(k, v string) bool
- func (e *Endpoint) Neighbors() []int
- func (e *Endpoint) NewEdge() *Edge
- func (e *Endpoint) String() string
- func (e *Endpoint) Type() int
- type Graph
- func (g *Graph) Connect(e, n Node, edge *Edge) error
- func (g *Graph) Delete(n Node) error
- func (g *Graph) Disconnect(n1, n2 Node) error
- func (g *Graph) FindEndpoints(k string, v string) []*Endpoint
- func (g *Graph) FindNetworks(k string, v string) []*Network
- func (g *Graph) FindNodes(k string, v string) []Node
- func (g *Graph) GetEndpoints() []*Endpoint
- func (g *Graph) GetNetworks() []*Network
- func (g *Graph) GetNodes() []Node
- func (g *Graph) HasNode(n Node) bool
- func (g *Graph) Insert(n Node) (Node, error)
- func (g *Graph) NewEndpoint() *Endpoint
- func (g *Graph) NewNetwork() *Network
- func (g *Graph) Update(n Node) (Node, error)
- func (g *Graph) Write(f io.Writer) error
- type Network
- type Node
Constants ¶
View Source
const ( TYPE_NODE = iota TYPE_ENDPOINT TYPE_NETWORK )
View Source
const (
UNCONNECTED = -1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
A network endpoint (regular endpoint, router, etc.). Endpoints contain a map for specifying arbitrary information (tags, disk images, etc.).
func (*Endpoint) Connected ¶
Connected returns true if the endpoint is connected to the node referenced by the given node ID.
type Graph ¶
func Read ¶
read graph contents from an io.Reader. If an io.EOF occurs without reading any data, assume an empty reader and return a new graph.
func (*Graph) Connect ¶
connect an endpoint to a network on a given edge. A node may only have a single connection to a given network. The edge must belong to e.
func (*Graph) Disconnect ¶
disconnect a node from a network.
func (*Graph) GetEndpoints ¶
func (*Graph) GetNetworks ¶
func (*Graph) NewEndpoint ¶
func (*Graph) NewNetwork ¶
Click to show internal directories.
Click to hide internal directories.