graph

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 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 {
	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 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 []*dbg.DbgMsgTx
}

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 New

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

func (*Graph) AddClient

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

func (*Graph) Clear

func (g *Graph) Clear()

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) ParseMsg

func (g *Graph) ParseMsg(id string, msgTx *dbg.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 {
	Inherited string
	Auto      bool
	Multi     bool
}

type StateRelation

type StateRelation struct {
	RelType am.Relation
}

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