topology

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2017 License: Apache-2.0 Imports: 8 Imported by: 58

Documentation

Index

Constants

View Source
const (
	OwnershipLink = "ownership"
	Layer2Link    = "layer2"
)

Describe the relation type between nodes

Variables

View Source
var (
	OwnershipMetadata = graph.Metadata{"RelationType": OwnershipLink}
	Layer2Metadata    = graph.Metadata{"RelationType": Layer2Link}
)

Describe the relation type between nodes in the graph

Functions

func AddLayer2Link(g *graph.Graph, node1 *graph.Node, node2 *graph.Node, metadata graph.Metadata) *graph.Edge

AddLayer2Link Link the parent and the child node

func AddOwnershipLink(g *graph.Graph, parent *graph.Node, child *graph.Node, metadata graph.Metadata) *graph.Edge

AddOwnershipLink Link the parent and the child node, the child can have only one parent, previous will be overwritten

func ExecuteGremlinQuery added in v0.10.0

func ExecuteGremlinQuery(g *graph.Graph, query string) (traversal.GraphTraversalStep, error)

ExecuteGremlinQuery run a gremlin query on the graph g

func GraphPath added in v0.4.0

func GraphPath(g *graph.Graph, n *graph.Node) string

GraphPath returns a string representation of the shortestpath between 2 host on the same owner

func HaveLayer2Link(g *graph.Graph, node1 *graph.Node, node2 *graph.Node, metadata graph.Metadata) bool

HaveLayer2Link returns true if parent and child have the same layer 2

func HaveOwnershipLink(g *graph.Graph, parent *graph.Node, child *graph.Node, metadata graph.Metadata) bool

HaveOwnershipLink returns true parent and child have the same ownership

func NamespaceFromNode added in v0.12.0

func NamespaceFromNode(g *graph.Graph, n *graph.Node) (string, string, error)

NamespaceFromNode returns the namespace name and the path of a node in the graph

func NewNetNSContextByNode added in v0.8.0

func NewNetNSContextByNode(g *graph.Graph, n *graph.Node) (*common.NetNSContext, error)

NewNetNSContextByNode creates a new network namespace context based on the node

Types

type HostNodeTIDMap added in v0.9.0

type HostNodeTIDMap map[string][]string

HostNodeTIDMap a map that store the value node TID and the key node host

func BuildHostNodeTIDMap added in v0.9.0

func BuildHostNodeTIDMap(nodes []*graph.Node) HostNodeTIDMap

BuildHostNodeTIDMap creates a new node and host (key) map

type NodePath added in v0.3.0

type NodePath []*graph.Node

NodePath describes a path in the graph between 2 nodes

func (NodePath) Marshal added in v0.3.0

func (p NodePath) Marshal() string

Marshal Serialize the node path

type TIDMapper added in v0.6.0

type TIDMapper struct {
	graph.DefaultGraphListener
	Graph *graph.Graph
	// contains filtered or unexported fields
}

TIDMapper describes the hostID nodes stored in a graph the mapper will broadcast node event to the registered listeners

func NewTIDMapper added in v0.6.0

func NewTIDMapper(g *graph.Graph) *TIDMapper

NewTIDMapper creates a new node mapper in the graph g

func (*TIDMapper) OnEdgeAdded added in v0.6.0

func (t *TIDMapper) OnEdgeAdded(e *graph.Edge)

OnEdgeAdded event

func (*TIDMapper) OnEdgeDeleted added in v0.11.0

func (t *TIDMapper) OnEdgeDeleted(e *graph.Edge)

OnEdgeDeleted event

func (*TIDMapper) OnEdgeUpdated added in v0.6.0

func (t *TIDMapper) OnEdgeUpdated(e *graph.Edge)

OnEdgeUpdated event

func (*TIDMapper) OnNodeAdded added in v0.6.0

func (t *TIDMapper) OnNodeAdded(n *graph.Node)

OnNodeAdded evetn

func (*TIDMapper) OnNodeUpdated added in v0.6.0

func (t *TIDMapper) OnNodeUpdated(n *graph.Node)

OnNodeUpdated event

func (*TIDMapper) Start added in v0.6.0

func (t *TIDMapper) Start()

Start the mapper

func (*TIDMapper) Stop added in v0.6.0

func (t *TIDMapper) Stop()

Stop the mapper

type TopologyTraversalExtension added in v0.4.0

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

TopologyTraversalExtension describes a new extension to enhance the topology

func NewTopologyTraversalExtension added in v0.4.0

func NewTopologyTraversalExtension() *TopologyTraversalExtension

NewTopologyTraversalExtension returns a new graph traversal mechanism externsion

func (*TopologyTraversalExtension) ParseStep added in v0.4.0

ParseStep parse the current step

func (*TopologyTraversalExtension) ScanIdent added in v0.4.0

ScanIdent returns an associated graph token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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