pipes

package
v0.19.5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 7 Imported by: 3

Documentation

Overview

Package pipes provide helpers to pipe states from one machine to another.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(
	source, target am.Api, sourceState string, targetState string,
) am.HandlerFinal

Add adds a pipe for an Add mutation between [source] and [target] machines, for a single target state.

targetState: defaults to sourceState

func AddFlat added in v0.13.0

func AddFlat(
	source, target am.Api, sourceState string, targetState string,
) am.HandlerFinal

AddFlat is like Add, but skips unnecessary mutations.

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

func BindAny(source, target am.Api) (string, error)

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

func BindErr(source, target am.Api, targetErr string) (string, error)

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

func BindMany(
	source, target am.Api, states, targetStates am.S,
) (string, error)

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 BindReady

func BindReady(
	source, target am.Api, activeState, inactiveState string,
) (string, error)

BindReady binds Ready to custom states using Add/. Empty state defaults to Ready.

func BindStart added in v0.10.3

func BindStart(
	source, target am.Api, activeState, inactiveState string,
) (string, error)

BindStart binds Start to custom states using Add/Remove. Empty state defaults to Start.

func Remove

func Remove(
	source, target am.Api, sourceState string, targetState string,
) am.HandlerFinal

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

func RemoveFlat(
	source, target am.Api, sourceState string, targetState string,
) am.HandlerFinal

func Sync added in v0.18.4

func Sync(
	source, target am.Api, states, targetStates am.S,
) int

Sync synchronizes states from source to target and returns the number of synced states. Useful when re-connecting a pipe source. When mixed with piping, Sync should be called inside rpc.Client.Eval().

Types

This section is empty.

Jump to

Keyboard shortcuts

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