Documentation ¶
Index ¶
- Constants
- Variables
- func AddLayer2Link(g *graph.Graph, node1 *graph.Node, node2 *graph.Node, metadata graph.Metadata) *graph.Edge
- func AddOwnershipLink(g *graph.Graph, parent *graph.Node, child *graph.Node, metadata graph.Metadata) *graph.Edge
- func ExecuteGremlinQuery(g *graph.Graph, query string) (traversal.GraphTraversalStep, error)
- func GraphPath(g *graph.Graph, n *graph.Node) string
- func HaveLayer2Link(g *graph.Graph, node1 *graph.Node, node2 *graph.Node, metadata graph.Metadata) bool
- func HaveOwnershipLink(g *graph.Graph, parent *graph.Node, child *graph.Node, metadata graph.Metadata) bool
- func IsOwnershipLinked(g *graph.Graph, node *graph.Node) bool
- func NamespaceFromNode(g *graph.Graph, n *graph.Node) (string, string, error)
- func NewNetNSContextByNode(g *graph.Graph, n *graph.Node) (*common.NetNSContext, error)
- type HostNodeTIDMap
- type NodePath
- type TIDMapper
- type TopologyTraversalExtension
Constants ¶
const ( OwnershipLink = "ownership" Layer2Link = "layer2" )
Describe the relation type between nodes
Variables ¶
var ( OwnershipMetadata = graph.Metadata{"RelationType": OwnershipLink} Layer2Metadata = graph.Metadata{"RelationType": Layer2Link} )
Describe the relation type between nodes in the graph
Functions ¶
func AddLayer2Link ¶ added in v0.11.0
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 ¶ added in v0.11.0
func AddOwnershipLink(g *graph.Graph, parent *graph.Node, child *graph.Node, metadata graph.Metadata) *graph.Edge
AddOwnershipLink Link between the parent and the child node, the child can have only one parent, previous will be overwritten
func ExecuteGremlinQuery ¶ added in v0.10.0
ExecuteGremlinQuery run a gremlin query on the graph g
func GraphPath ¶ added in v0.4.0
GraphPath returns a string representation of the shortestpath between 2 host on the same owner
func HaveLayer2Link ¶ added in v0.11.0
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 ¶ added in v0.11.0
func HaveOwnershipLink(g *graph.Graph, parent *graph.Node, child *graph.Node, metadata graph.Metadata) bool
HaveOwnershipLink returns true if parent and child have an ownership link
func IsOwnershipLinked ¶ added in v0.13.0
IsOwnershipLinked checks whether the node as an OwnershipLink
func NamespaceFromNode ¶ added in v0.12.0
NamespaceFromNode returns the namespace name and the path of a node in the graph
func NewNetNSContextByNode ¶ added in v0.8.0
NewNetNSContextByNode creates a new network namespace context based on the node
Types ¶
type HostNodeTIDMap ¶ added in v0.9.0
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 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
NewTIDMapper creates a new node mapper in the graph g
func (*TIDMapper) OnEdgeAdded ¶ added in v0.6.0
OnEdgeAdded event
func (*TIDMapper) OnEdgeDeleted ¶ added in v0.11.0
OnEdgeDeleted event
func (*TIDMapper) OnEdgeUpdated ¶ added in v0.6.0
OnEdgeUpdated event
func (*TIDMapper) OnNodeAdded ¶ added in v0.6.0
OnNodeAdded evetn
func (*TIDMapper) OnNodeUpdated ¶ added in v0.6.0
OnNodeUpdated event
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
func (e *TopologyTraversalExtension) ParseStep(t traversal.Token, p traversal.GremlinTraversalContext) (traversal.GremlinTraversalStep, error)
ParseStep parse the current step