Documentation ¶
Index ¶
- Constants
- func Draw(gi *GraphInfo, nodeCh <-chan xray.NodeID, h Handler) (*gographviz.Graph, error)
- type DefaultHandler
- type EdgePair
- type GraphInfo
- type Handler
- type NodeInfo
- type Processor
- func (p *Processor) AddEdge(src, dst xray.NodeID, srcField string, attr map[string]string)
- func (p *Processor) AddNode(node xray.NodeID, graph *xray.NodeID, attr map[string]string)
- func (p *Processor) AddSubgraph(child xray.NodeID, parent *xray.NodeID)
- func (p *Processor) RemoveNode(node xray.NodeID)
- func (p *Processor) Render() (*gographviz.Graph, error)
Constants ¶
const (
// GraphName is the default name for graph
GraphName = "G"
)
const (
// Label marks the label key for the node
Label = "label"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultHandler ¶
type DefaultHandler struct {
Processor
}
DefaultHandler is the default dot handler
type EdgePair ¶
type EdgePair struct {
// contains filtered or unexported fields
}
EdgePair describes the source and designation of an edge it's also used to identify the edge
type GraphInfo ¶
type GraphInfo struct { // scanned results, all nodes that has been scanned Nodes map[xray.NodeID]*xray.Node // maps stores the KV pairs for each map Maps map[xray.NodeID]map[xray.NodeID]xray.NodeID }
GraphInfo contains the raw node data collected without being processed
func NewGraphInfo ¶
NewGraphInfo construct the graph info from scanner
type Handler ¶
Handler is the interface for hanling a specific node it can read the global nodes information, and it's can use its custome logic to manage the objects to be rendered
type NodeInfo ¶
type NodeInfo struct {
// contains filtered or unexported fields
}
NodeInfo stores the necessary information to construct a node in dot format if graph points to nil then the node should be added to the outmost graph
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor is used for convert the node information to gographviz.Graph
func (*Processor) AddSubgraph ¶
AddSubgraph registers an subgraph
func (*Processor) RemoveNode ¶
RemoveNode removes the node