Documentation
¶
Overview ¶
Package pipes provide helpers to pipe states from one machine to another.
Index ¶
- func Add(source, target am.Api, sourceState string, targetState string) am.HandlerFinal
- func AddFlat(source, target am.Api, sourceState string, targetState string) am.HandlerFinal
- func Bind(source, target am.Api, state string, activeState, inactiveState string) (string, error)
- func BindAny(source, target am.Api) (string, error)
- func BindConnected(source, target am.Api, ...) (string, error)
- func BindErr(source, target am.Api, targetErr string) (string, error)
- func BindMany(source, target am.Api, states, targetStates am.S) (string, error)
- func BindReady(source, target am.Api, activeState, inactiveState string) (string, error)
- func BindStart(source, target am.Api, activeState, inactiveState string) (string, error)
- func Remove(source, target am.Api, sourceState string, targetState string) am.HandlerFinal
- func RemoveFlat(source, target am.Api, sourceState string, targetState string) am.HandlerFinal
- func Sync(source, target am.Api, states, targetStates am.S) int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add adds a pipe for an Add mutation between [source] and [target] machines, for a single target state.
targetState: defaults to sourceState
func Bind ¶ added in v0.17.0
func Bind( source, target am.Api, state string, activeState, inactiveState string, ) (string, error)
Bind binds an arbitrary state to custom states using Add and Remove. Empty [activeState] and [inactiveState] defaults to [source]. Each binding creates a separate handler struct, unlike in BindMany.
func BindAny ¶ added in v0.17.0
BindAny binds a whole machine via the global AnyState handler and Set mutation. The target mutates the same number of times as the source.
func BindConnected ¶
func BindConnected( source, target am.Api, disconnected, connecting, connected, disconnecting string, ) (string, error)
BindConnected binds a ss.ConnectedSchema machine to 4 custom states. Each one is optional and bound with Add/Remove.
func BindErr ¶
BindErr binds Exception to a custom state using Add. Empty state defaults to am.StateException, and a custom state will also add am.StateException.
func BindMany ¶ added in v0.17.0
BindMany binds arbitrary states to a mirrored list of states using Add and Remove. Only one handler struct is created for all the bindings.
func BindStart ¶ added in v0.10.3
BindStart binds Start to custom states using Add/Remove. Empty state defaults to Start.
func Remove ¶
Remove adds a pipe for a Remove mutation between source and target machines, for a single target state.
targetState: defaults to sourceState
func RemoveFlat ¶ added in v0.13.0
Types ¶
This section is empty.