topology

package module
v0.0.0-...-3fab846 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

README

topology

一个用于构建拓扑图的包

声明

源码是从sky-div的基础上修改,遵循原协议.

获取源码

go get github.com/songtianyi/topology

用例

TODO

Documentation

Index

Constants

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

Variables

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

Functions

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

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

func GraphPath

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 NamespaceFromNode

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

func NewNetNSContextByNode

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

Types

type GraphPathGremlinTraversalStep

type GraphPathGremlinTraversalStep struct {
}

func (*GraphPathGremlinTraversalStep) Context

func (*GraphPathGremlinTraversalStep) Exec

func (*GraphPathGremlinTraversalStep) Reduce

type GraphPathTraversalStep

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

func (*GraphPathTraversalStep) Error

func (p *GraphPathTraversalStep) Error() error

func (*GraphPathTraversalStep) MarshalJSON

func (p *GraphPathTraversalStep) MarshalJSON() ([]byte, error)

func (*GraphPathTraversalStep) Values

func (p *GraphPathTraversalStep) Values() []interface{}

type HostNodeTIDMap

type HostNodeTIDMap map[string][]string

func BuildHostNodeTIDMap

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

type NodePath

type NodePath []*graph.Node

func (NodePath) Marshal

func (p NodePath) Marshal() string

type TIDMapper

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

func NewTIDMapper

func NewTIDMapper(g *graph.Graph) *TIDMapper

func (*TIDMapper) OnEdgeAdded

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

func (*TIDMapper) OnEdgeDeleted

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

func (*TIDMapper) OnEdgeUpdated

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

func (*TIDMapper) OnNodeAdded

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

func (*TIDMapper) OnNodeUpdated

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

func (*TIDMapper) Start

func (t *TIDMapper) Start()

func (*TIDMapper) Stop

func (t *TIDMapper) Stop()

type TopologyTraversalExtension

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

func NewTopologyTraversalExtension

func NewTopologyTraversalExtension() *TopologyTraversalExtension

func (*TopologyTraversalExtension) ScanIdent

Directories

Path Synopsis
Package filters is a generated protocol buffer package.
Package filters is a generated protocol buffer package.
storage

Jump to

Keyboard shortcuts

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