states

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package states contains a stateful schema-v2 for Repl. Bootstrapped with am-gen. Edit manually or re-gen & merge.

Index

Constants

This section is empty.

Variables

View Source
var (

	// ReplStates contains all the states for the Repl machine.
	ReplStates = ssC
	// ReplGroups contains all the state groups for the Repl machine.
	ReplGroups = sgC
)
View Source
var Exception = am.Exception

Exception is a type alias for the exception state.

View Source
var ReplStruct = StructMerge(

	ss.BasicStruct,

	ss.DisposedStruct,
	am.Struct{

		ssC.ErrSyntax: {},

		ssC.Disconnected: {
			Remove: S{ssC.Connecting, ssC.ConnectedFully, ssC.Disconnecting},
		},
		ssC.Connecting: {
			Require: S{ssC.Start},
			Remove:  S{ssC.Disconnecting},
		},
		ssC.Connected: {
			Require: S{ssC.Start},
			Remove:  S{ssC.Disconnected},
		},
		ssC.ConnectedFully: {
			Require: S{ssC.Connected},
			Remove:  S{ssC.Disconnected},
		},
		ssC.Disconnecting: {
			Remove: S{ssC.ConnectedFully, ssC.Connected, ssC.Connecting},
		},

		ssC.RpcConn:    {Multi: true},
		ssC.RpcDisconn: {Multi: true},

		ssC.CmdAdd: {
			Multi:   true,
			Require: S{ssC.Connected},
		},
		ssC.CmdRemove: {
			Multi:   true,
			Require: S{ssC.Connected},
		},
		ssC.CmdGroupAdd: {
			Multi:   true,
			Require: S{ssC.Connected},
		},
		ssC.CmdGroupRemove: {
			Multi:   true,
			Require: S{ssC.Connected},
		},
		ssC.CmdList: {
			Multi:   true,
			Require: S{ssC.Connected},
		},
		ssC.CmdScript: {
			Multi:   true,
			Require: S{ssC.Connected},
		},
		ssC.CmdWhenTime: {
			Multi:   true,
			Require: S{ssC.Connected},
		},
		ssC.CmdWhen: {
			Multi:   true,
			Require: S{ssC.Connected},
		},
		ssC.CmdWhenNot: {
			Multi:   true,
			Require: S{ssC.Connected},
		},
		ssC.CmdInspect: {
			Multi:   true,
			Require: S{ssC.Connected},
		},
		ssC.CmdStatus: {
			Multi:   true,
			Require: S{ssC.Connected},
		},

		ssC.ReplMode: {Require: S{ssC.Start}},

		ssC.ListMachines: {
			Multi:   true,
			Require: S{ssC.Start},
		},
	})

ReplStruct represents all relations and properties of ReplStates.

View Source
var SAdd = am.SAdd

SAdd is a func alias for merging lists of states.

View Source
var StateAdd = am.StateAdd

StateAdd is a func alias for adding to an existing state definition.

View Source
var StateSet = am.StateSet

StateSet is a func alias for replacing parts of an existing state definition.

View Source
var StructMerge = am.StructMerge

StructMerge is a func alias for extending an existing state structure.

Functions

This section is empty.

Types

type ReplGroupsDef

type ReplGroupsDef struct {
	*ss.ConnectedGroupsDef

	Cmds S
}

ReplGroupsDef contains all the state groups Repl state machine.

type ReplStatesDef

type ReplStatesDef struct {
	*am.StatesBase

	ErrSyntax string

	Disconnected   string
	Connecting     string
	Connected      string
	ConnectedFully string
	Disconnecting  string

	RpcConn    string
	RpcDisconn string

	CmdAdd         string
	CmdRemove      string
	CmdGroupAdd    string
	CmdGroupRemove string
	CmdList        string
	CmdScript      string
	CmdWhenTime    string
	CmdWhen        string
	CmdWhenNot     string
	CmdInspect     string
	CmdStatus      string

	// REPL is running in a TUI mode
	ReplMode string
	// List fully connected machines, with filters.
	ListMachines string

	// inherit from BasicStatesDef
	*ss.BasicStatesDef
	// inherit from DisposedStatesDef
	*ss.DisposedStatesDef
}

ReplStatesDef contains all the states of the Repl state machine.

type S

type S = am.S

S is a type alias for a list of state names.

type State

type State = am.State

State is a type alias for a state definition. See am.State.

Jump to

Keyboard shortcuts

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