package
0.3.5
Repository: https://github.com/netrixframework/netrix.git
Documentation: pkg.go.dev

# Functions

ConditionWithAction creates a condition with the side effect given by Action.
Count returns a CountWrapper where the CounterFunc fetches the counter based on the label.
CountF returns a CountWrapper where the label is also fetched based on the event and context.
CountTo returns a CountWrapper where the counter label is `label` appended with message.To, if the event is a message send or receive.
IsEventOf returns true if the event if of the specified replica.
IsEventOfF accepts a function to specify the replica and returns true if the event is of that corresponding replica.
IsEventType condition returns true if the event is of type [types.GenericEventType] with T == t.
IsMessage between condition is true when the underlying event is a message between the two specified processes.
IsMessageFrom condition returns true if the event is a message send or receive with message.From == from.
IsMessageFromF works the same as IsMessageFrom but the replica is fetched from the event and context.
IsMessageReceive condition returns true if the event is a message receive event.
IsMessageSend condition returns true if the event is a message send event.
IsMessageTo condition returns true if the event is a message send or receive with message.To == to.
IsMessageToF works the same as IsMessageTo but the replica is fetched from the event and context.
IsMessageType condition returns true if the event is a message send or receive and the type of message is `t`.
NewContext creates a new context from the global context object.
NewStateMachine instantiate a StateMachine.
Once is a meta condition that allows the inner condition to be true only once.
Set returns a SetWrapper where the set is fetched based on the label.
SetF returns a SetWrapper where the label is determined dynamically by the event and context.

# Constants

FailStateLabel is the failure state label.
StartStateLabel is the start state label of a state machine.
SuccessStateLabel is the state label of the success state.

# Structs

Context used to step the state machine.
CountWrapper encapsulates the function to fetch counter (CounterFunc) from state dynamically.
SetWrapper encapsulates the mechanism to fetch a message set from the state.
State of the testcase state machine.
StateMachine is a deterministic transition system where the transitions are labelled by conditions.
StateMachineBuilder struct defines a builder pattern to create a state machine.

# Type aliases

Action is a generic function that can be used to define side effects in the context.
Condition a generic function that used to transition the [StateMachine] from one state to the next.