Documentation
¶
Overview ¶
Package graph provides a graph or interconnected state-machines and their states, based on the dbg telemetry protocol.
Index ¶
- Variables
- func AddErrGraph(event *am.Event, mach *am.Machine, err error, args ...am.A) am.Result
- func Markdown(inspect map[string]*MachInspect) string
- type Client
- type Connection
- type Edge
- type EdgeData
- type Graph
- func (g *Graph) AddClient(msg *dbg.DbgMsgStruct) error
- func (g *Graph) Clear()
- func (g *Graph) Clone() (*Graph, error)
- func (g *Graph) Connection(source, target string) (*Connection, error)
- func (g *Graph) DumpGv(path string) error
- func (g *Graph) Inspect() (map[string]*MachInspect, error)
- func (g *Graph) ParseMsg(id string, msgTx *dbg.DbgMsgTx)
- func (g *Graph) RemoveClient(id string) error
- type MachInspect
- type MachPipeTo
- type MachineHas
- type StateRelation
- type Vertex
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrGraph = errors.New("graph error")
Functions ¶
func AddErrGraph ¶ added in v0.18.8
AddErrGraph adds ErrGraph.
func Markdown ¶ added in v0.18.6
func Markdown(inspect map[string]*MachInspect) string
Types ¶
type Client ¶
type Client struct {
Id string
// TODO version schemas
MsgSchema *dbg.DbgMsgStruct
LatestMsgTx *dbg.DbgMsgTx
LatestTimeSum uint64
LatestClock am.Time
ConnId string
}
Client represents a single state machine withing the network graph.
type Connection ¶
type EdgeData ¶
type EdgeData struct {
// machine has a state
MachHas *MachineHas
// machine has an RPC connection to another machine
MachConnectedTo bool
// machine is a child of another machine
MachChildOf bool
// machine has pipes going to another machine
MachPipesTo []*MachPipeTo
// state has relations with other states
StateRelation []*StateRelation
}
type Graph ¶
type Graph struct {
Server *am.Machine
Clients map[string]*Client
// G is a directed graph of machines and states with metadata.
G graph.Graph[string, *Vertex]
// Map is a unidirectional mirror of g, without metadata.
Map graph.Graph[string, *Vertex]
}
func (*Graph) Connection ¶
func (g *Graph) Connection(source, target string) (*Connection, error)
Connection returns a Connection for the given source-target.
func (*Graph) DumpGv ¶ added in v0.18.1
DumpGv will create a dot-format *.gv file of the graph. To create an SVG:
dot -Tsvg -O path
func (*Graph) RemoveClient ¶
type MachInspect ¶ added in v0.18.6
type MachPipeTo ¶
type MachPipeTo struct {
FromState string
ToState string
MutType am.MutationType
}
TODO use am.Pipe
type MachineHas ¶
type StateRelation ¶
Click to show internal directories.
Click to hide internal directories.