graph

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package graph provides a graph or interconnected state-machines and their states, based on the dbg telemetry protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// bits which get saved into the go file
	// Exportable
	MsgStruct *telemetry.DbgMsgStruct

	Id string

	// indexes of txs with errors, desc order for bisects
	// TODO refresh on GC
	LatestMsgTx   *telemetry.DbgMsgTx
	LatestTimeSum uint64
	LatestClock   am.Time
}

type Connection

type Connection struct {
	Edge   *EdgeData
	Source *Vertex
	Target *Vertex
}

type Edge

type Edge = graph.Edge[*Vertex]

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 Exportable

type Exportable struct {
	MsgTxs []*telemetry.DbgMsgTx
}

type Graph

type Graph struct {
	Mach *am.Machine
	// contains filtered or unexported fields
}

func New

func New(m *am.Machine) (*Graph, error)

func (*Graph) AddClient

func (g *Graph) AddClient(msg *telemetry.DbgMsgStruct) error

func (*Graph) Clear

func (g *Graph) Clear()

func (*Graph) Clients

func (g *Graph) Clients() map[string]*Client

func (*Graph) Clone

func (g *Graph) Clone() (*Graph, error)

Clone returns a deep clone of the graph.

func (*Graph) Connection

func (g *Graph) Connection(source, target string) (*Connection, error)

Connection returns a Connection for the given source-target.

func (*Graph) G

func (g *Graph) G() graph.Graph[string, *Vertex]

func (*Graph) Map

func (g *Graph) Map() graph.Graph[string, *Vertex]

func (*Graph) ParseMsg

func (g *Graph) ParseMsg(id string, msgTx *telemetry.DbgMsgTx)

func (*Graph) RemoveClient

func (g *Graph) RemoveClient(id string) error

type MachPipeTo

type MachPipeTo struct {
	FromState string
	ToState   string
	MutType   am.MutationType
}

type MachineHas

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

type StateRelation

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

type Vertex

type Vertex struct {
	StateName string
	MachId    string
}

Jump to

Keyboard shortcuts

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