states

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// DebuggerStates contains all the states for the debugger machine.
	DebuggerStates = ssD
	// DebuggerGroups contains all the state groups for the debugger machine.
	DebuggerGroups = sgD
)
View Source
var DebuggerSchema = ssam.BasicSchema.Merge(
	ServerSchema,
	ssrpc.StateSourceSchema,
	ssam.DisposedSchema,
	am.Schema{

		ssD.ErrDiagrams: {
			Multi:   true,
			Require: S{Exception},
		},
		ssD.ErrWeb: {
			Multi:   true,
			Require: S{Exception},
		},
		ssD.ErrUi: {
			Multi:   true,
			Require: S{Exception},
		},

		ssD.WebReqDiag: {
			Multi:   true,
			Require: S{Start},
		},
		ssD.WebSocketDiag: {
			Multi:   true,
			Require: S{Start},
		},

		ssD.UserFwd: {
			Add:    S{ssD.Fwd},
			Remove: sgD.Playing,
		},
		ssD.UserBack: {
			Add:    S{ssD.Back},
			Remove: sgD.Playing,
		},
		ssD.UserFwdMarker: {
			Add:     S{ssD.FwdMarker},
			Require: S{ssD.ClientSelected},
			Remove:  sgD.Playing.Add1(ssD.LogUserScrolled),
		},
		ssD.UserBackMarker: {
			Add:     S{ssD.BackMarker},
			Require: S{ssD.ClientSelected},
			Remove:  sgD.Playing.Add1(ssD.LogUserScrolled),
		},

		ssD.TreeFocused:            {Remove: sgD.Focused},
		ssD.TreeGroupsFocused:      {Remove: sgD.Focused},
		ssD.LogFocused:             {Remove: sgD.Focused},
		ssD.ClientListFocused:      {Remove: sgD.Focused},
		ssD.TimelineTxsFocused:     {Remove: sgD.Focused},
		ssD.TimelineMarkersFocused: {Remove: sgD.Focused},
		ssD.MatrixFocused:          {Remove: sgD.Focused},
		ssD.DialogFocused:          {Remove: sgD.Focused},
		ssD.Toolbar1Focused:        {Remove: sgD.Focused},
		ssD.Toolbar2Focused:        {Remove: sgD.Focused},
		ssD.Toolbar3Focused:        {Remove: sgD.Focused},
		ssD.Toolbar4Focused:        {Remove: sgD.Focused},
		ssD.LogReaderFocused: {
			Require: S{ssD.LogReaderVisible},
			Remove:  sgD.Focused,
		},
		ssD.AddressFocused: {Remove: sgD.Focused},
		ssD.Resized:        {Multi: true},

		ssD.TimelineTxHidden:      {Require: S{ssD.TimelineMarkersHidden}},
		ssD.TimelineMarkersHidden: {},
		ssD.NarrowLayout: {
			Require: S{ssD.Ready},
			Remove:  S{ssD.ClientListVisible},
		},
		ssD.UserNarrowLayout:  {Add: S{ssD.NarrowLayout}},
		ssD.ClientListVisible: {},
		ssD.StateNameSelected: {
			Multi:   true,
			Require: S{ssD.ClientSelected},
		},
		ssD.HelpDialog: {
			Add:    S{ssD.DialogFocused},
			Remove: sgD.Dialog.Add(sgD.Focused),
		},
		ssD.ExportDialog: {
			Add:    S{ssD.DialogFocused},
			Remove: sgD.Dialog.Add(sgD.Focused),
		},
		ssD.LogUserScrolled: {
			Remove: S{ssD.Playing, ssD.TailMode},

			Require: S{ssD.LogFocused},
		},
		Ready: {
			Require: S{Start},
			Add:     S{ssD.UpdateFocus},
		},

		ssD.FilterAutoTx:         {Remove: S{ssD.FilterAutoCanceledTx}},
		ssD.FilterAutoCanceledTx: {Remove: S{ssD.FilterAutoTx}},
		ssD.FilterCanceledTx:     {},
		ssD.FilterQueuedTx:       {},
		ssD.FilterEmptyTx:        {},
		ssD.FilterDisconn:        {},
		ssD.LogTimestamps:        {},
		ssD.FilterTraces:         {},
		ssD.FilterHealth:         {},
		ssD.FilterChecks:         {},
		ssD.FilterRpcMachs:       {},
		ssD.FilterOutGroup:       {},
		ssD.Redraw:               {},
		ssD.Loading:              {},

		Start: {Add: S{
			ssD.LogTimestamps, ssD.FilterHealth, ssD.ClientListFocused,
			ssD.FilterAutoCanceledTx, ssD.ClientListVisible,
		}},
		ssD.Heartbeat: {
			Multi:   true,
			Require: S{Start},
		},
		ssD.GcMsgs: {
			Add: S{ssD.Loading},
			Remove: S{ssD.SelectingClient, ssD.SwitchedClientTx, ssD.ScrollToTx,
				ssD.ScrollToMutTx},
		},
		ssD.TreeLogView: {
			Auto:    true,
			Require: S{Start},
			Remove:  sgD.Views.Add1(ssD.MatrixRain),
		},
		ssD.MatrixView:     {Remove: sgD.Views.Add1(ssD.LogReaderVisible)},
		ssD.TreeMatrixView: {Remove: sgD.Views.Add1(ssD.LogReaderVisible)},
		ssD.TailMode: {
			Require: S{ssD.ClientSelected},
			Remove:  sgD.Playing.Add1(ssD.LogUserScrolled),
		},
		ssD.Playing: {
			Require: S{ssD.ClientSelected},
			Remove:  sgD.Playing.Add1(ssD.LogUserScrolled),
		},
		ssD.Paused: {
			Auto:    true,
			Require: S{ssD.ClientSelected},
			Remove:  sgD.Playing,
		},
		ssD.ToggleTool:  {Remove: S{ssD.ToolToggled}},
		ssD.ToolToggled: {Remove: S{ssD.ToggleTool}},
		ssD.SwitchingClientTx: {
			Require: S{ssD.Ready},
			Remove:  S{ssD.SwitchedClientTx},
		},
		ssD.SwitchedClientTx: {
			Require: S{ssD.Ready},
			Remove:  S{ssD.SwitchingClientTx},
		},
		ssD.ScrollToMutTx: {Require: S{ssD.ClientSelected}},

		ssD.MatrixRain: {},
		ssD.MatrixRainSelected: {
			Multi:   true,
			Require: S{ssD.MatrixRain, ssD.ClientSelected},
		},
		ssD.LogReaderVisible: {
			Auto:    true,
			Require: S{ssD.TreeLogView, ssD.LogReaderEnabled},
		},
		ssD.LogReaderEnabled:   {},
		ssD.UpdateLogScheduled: {Require: S{ssD.Ready}},
		ssD.UpdatingLog: {
			Require: S{ssD.Ready, ssD.ClientSelected},
			Remove:  S{ssD.LogUpdated},
		},
		ssD.LogUpdated: {
			Require: S{ssD.Ready, ssD.ClientSelected},
			Remove:  S{ssD.UpdatingLog},
		},
		ssD.UpdateLogReader: {Require: S{ssD.Ready, ssD.LogReaderEnabled}},
		ssD.UpdateFocus: {
			Multi:   true,
			Require: S{ssD.Ready},
		},
		ssD.Overlay: {Require: S{ssD.LogReaderFocused}},
		ssD.AfterFocus: {
			Multi:   true,
			Require: S{ssD.Ready},
		},
		ssD.FocusPrev: {
			Multi:   true,
			Require: S{ssD.Ready},
		},
		ssD.FocusNext: {
			Multi:   true,
			Require: S{ssD.Ready},
		},
		ssD.ToolRain: {
			Multi:   true,
			Require: S{ssD.Ready},
		},

		ssD.Fwd: {
			Require: S{ssD.ClientSelected},
			Remove:  S{ssD.Overlay},
		},
		ssD.Back: {
			Require: S{ssD.ClientSelected},
			Remove:  S{ssD.Overlay},
		},
		ssD.FwdMarker: {
			Require: S{ssD.ClientSelected},
		},
		ssD.BackMarker: {
			Require: S{ssD.ClientSelected},
		},

		ssD.ScrollToTx: {
			Multi:   true,
			Require: S{ssD.ClientSelected},
			Remove:  S{ssD.TailMode, ssD.Playing},
		},
		ssD.ScrollToMarker: {
			Require: S{ssD.ClientSelected},
			Remove:  S{ssD.TailMode, ssD.Playing},
		},
		ssD.ToggleMark: {
			Multi:   true,
			Require: S{ssD.ClientSelected},
		},

		ssD.SelectingClient: {
			Add:     S{ssD.Loading},
			Require: S{Start},
			Remove:  S{ssD.ClientSelected, ssD.Overlay},
		},
		ssD.ClientSelected: {
			Require: S{Start},
			Remove:  S{ssD.SelectingClient},
		},
		ssD.TxSelected: {
			Require: S{ssD.ClientSelected},
		},
		ssD.RemoveClient: {Require: S{ssD.ClientSelected}},
		ssD.BuildingLog: {
			Require: S{ssD.ClientSelected},
			Remove:  S{ssD.LogBuilt},
			After:   S{ssD.ClientSelected},
		},
		ssD.LogBuilt: {
			Require: S{ssD.ClientSelected},
			Remove:  S{ssD.BuildingLog},
		},

		ssD.SetCursor: {Require: S{ssD.Ready}},
		ssD.SetGroup: {
			Multi:   true,
			Require: S{ssD.ClientSelected},
		},
		ssD.SshServer: {Require: S{Start}},
		ssD.SshDisconn: {
			Multi:   true,
			Require: S{ssD.SshServer},
		},

		ssD.DiagramsGraphRendering: {
			Multi:   true,
			Require: S{ssD.Ready},
			Add:     S{ssD.Loading},
			Remove:  S{ssD.DiagramsGraphReady},
		},
		ssD.DiagramsGraphReady: {
			Require: S{ssD.Ready},
			Remove:  S{ssD.DiagramsGraphRendering},
		},
		ssD.DiagramsMachRendering: {
			Multi:   true,
			Require: S{ssD.ClientSelected},
			Add:     S{ssD.Loading},
			Remove:  S{ssD.DiagramsMachReady},
		},
		ssD.DiagramsMachReady: {
			Require: S{ssD.ClientSelected},
			Remove:  S{ssD.DiagramsMachRendering},
		},
		ssD.DiagramsStatesRendering: {
			Multi:   true,
			Require: S{ssD.ClientSelected},
			Add:     S{ssD.Loading},
			Remove:  S{ssD.DiagramsStatesReady},
		},
		ssD.DiagramsStatesReady: {
			Require: S{ssD.ClientSelected},
			Remove:  S{ssD.DiagramsStatesRendering},
		},
	},
)

DebuggerSchema represents all relations and properties of DebuggerStates.

View Source
var ServerSchema = am.Schema{
	ssV.ErrGraph: {Require: S{Exception}},
	ssV.ConnectEvent: {
		Multi:   true,
		Require: S{Start}},
	ssV.ClientMsg: {
		Multi:   true,
		Require: S{Start}},
	ssV.DisconnectEvent: {
		Multi:   true,
		Require: S{Start}},
	ssV.InitClient: {
		Multi:   true,
		Require: S{Start}},
}

ServerSchema represents all relations and properties of ServerStates.

View Source
var (

	// ServerStates contains all the states for the Server machine.
	ServerStates = ssV
)

Functions

This section is empty.

Types

type DebuggerGroupsDef added in v0.18.8

type DebuggerGroupsDef struct {

	// Focused represents focus-related states, 1 active at a time.
	Focused S

	// Views represents view-related states, 1 active at a time.
	Views S

	// Playing represents playback-related states, 1 active at a time.
	Playing S

	// ClientTx represents client transaction states, 1 active at a time.
	ClientTx S

	// Filters represents filter states.
	Filters S

	// Dialog represents dialog-related states.
	Dialog S

	// Debug contains states useful when debugging the debugger in another
	// debugger.
	Debug S

	// Machine diagram rendering states.
	DiagramsMach S

	Mcp         S
	McpReadonly S

	// states triggering the Loading state
	Loading S
}

DebuggerGroupsDef contains all the state groups of the debugger state machine.

type DebuggerStatesDef added in v0.18.8

type DebuggerStatesDef struct {
	*am.StatesBase

	// errors
	ErrDiagrams string
	ErrUi       string
	ErrWeb      string

	// web req for diagram viewer
	WebReqDiag string
	// websocket conn for diagram viewer
	WebSocketDiag string

	// input events
	UserFwd        string
	UserBack       string
	UserFwdMarker  string
	UserBackMarker string

	// focus group
	TreeFocused            string
	TreeGroupsFocused      string
	LogFocused             string
	ClientListFocused      string
	TimelineTxsFocused     string
	TimelineMarkersFocused string
	MatrixFocused          string
	DialogFocused          string
	Toolbar1Focused        string
	Toolbar2Focused        string
	Toolbar3Focused        string
	Toolbar4Focused        string
	LogReaderFocused       string
	AddressFocused         string
	Resized                string

	// view states
	TimelineTxHidden      string
	TimelineMarkersHidden string
	NarrowLayout          string
	UserNarrowLayout      string
	ClientListVisible     string
	StateNameSelected     string
	HelpDialog            string
	ExportDialog          string
	LogUserScrolled       string
	Ready                 string
	FilterAutoTx          string
	FilterAutoCanceledTx  string
	FilterCanceledTx      string
	FilterQueuedTx        string
	FilterEmptyTx         string
	FilterDisconn         string
	LogTimestamps         string
	FilterTraces          string
	FilterHealth          string
	FilterChecks          string
	FilterRpcMachs        string
	FilterOutGroup        string
	Redraw                string
	Loading               string

	// actions
	Start             string
	Heartbeat         string
	GcMsgs            string
	TreeLogView       string
	MatrixView        string
	TreeMatrixView    string
	TailMode          string
	Playing           string
	Paused            string
	ToggleTool        string
	ToolToggled       string
	SwitchingClientTx string
	SwitchedClientTx  string
	// ScrollToMutTxState scrolls to a transition which mutated the passed state,
	// If fwd is true, it scrolls forward, otherwise backwards.
	ScrollToMutTx      string
	MatrixRain         string
	MatrixRainSelected string
	LogReaderVisible   string
	LogReaderEnabled   string
	UpdateLogScheduled string
	UpdatingLog        string
	LogUpdated         string
	UpdateLogReader    string
	UpdateFocus        string
	Overlay            string
	AfterFocus         string
	FocusPrev          string
	FocusNext          string
	ToolRain           string

	// tx / markers back / fwd
	Fwd            string
	Back           string
	FwdMarker      string
	BackMarker     string
	ScrollToTx     string
	ScrollToMarker string
	ToggleMark     string

	// client selection
	SelectingClient string
	ClientSelected  string
	TxSelected      string
	RemoveClient    string
	// TODO call UpdatingLog with partial acceptance and delegate to
	// BuildingLog if out of bounds
	BuildingLog string
	LogBuilt    string

	SetCursor  string
	SetGroup   string
	SshServer  string
	SshDisconn string

	DiagramsGraphRendering string
	DiagramsGraphReady     string
	DiagramsMachRendering  string
	DiagramsMachReady      string
	// pre-render all state-zoom diagrams for the selected machine
	DiagramsStatesRendering string
	DiagramsStatesReady     string

	*ssam.BasicStatesDef
	*ServerStatesDef
	*ssrpc.StateSourceStatesDef
	*ssam.DisposedStatesDef
}

DebuggerStatesDef contains all the states of the debugger state machine.

type ServerStatesDef added in v0.16.1

type ServerStatesDef struct {
	*am.StatesBase

	ErrGraph string

	ConnectEvent    string
	ClientMsg       string
	DisconnectEvent string
	// TODO this never passes negotiation in am-dbg imports
	InitClient string
}

ServerStatesDef contains all the states of the debugger server state machine, used to listen for RPC connections and msgD.

Jump to

Keyboard shortcuts

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