states

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Start         = ss.Start
	Ready         = ss.Ready
	HandshakeDone = ss.HandshakeDone
	Handshaking   = ss.Handshaking

	RpcStarting = "RpcStarting"
	RpcReady    = "RpcReady"

	ClientConn    = "ClientConn"
	ClientDisconn = "ClientDisconn"

	ErrNetwork = ss.ErrNetwork
	ErrClient  = ss.ErrRpc
)

Variables

View Source
var (
	GroupRPC        = S{RpcStarting, RpcReady}
	GroupClientConn = S{ClientConn, ClientDisconn}
)

Names is an ordered list of all the state names.

View Source
var SMerge = am.SAdd

SMerge 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 States = StructMerge(ss.States, am.Struct{

	ss.ErrNetwork: StateAdd(ss.States[ss.ErrNetwork], am.State{
		Remove: S{ClientConn},
	}),

	ss.Start: {Add: S{RpcStarting}},
	ss.Ready: {
		Auto:    true,
		Require: S{HandshakeDone, RpcReady},
	},

	RpcStarting: {
		Require: S{ss.Start},
		Remove:  GroupRPC,
	},
	RpcReady: {
		Require: S{ss.Start},
		Remove:  GroupRPC,
	},

	ClientConn: {
		Require: S{RpcReady},
		Remove:  GroupClientConn,
	},
	ClientDisconn: {
		Auto:    true,
		Require: S{RpcReady},
		Remove:  GroupClientConn,
	},
})

States map defines relations and properties of states. Base on shared rpc states.

View Source
var StructMerge = am.StructMerge

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

Functions

This section is empty.

Types

type S

type S = am.S

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

Jump to

Keyboard shortcuts

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