Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMsgSkip is an error returned when checking a received msg when a msg // is not to be checked. ErrScenarioMsgSkip = errors.New("msg skipped") )
Functions ¶
This section is empty.
Types ¶
type Scenario ¶
type Scenario struct {
// contains filtered or unexported fields
}
Scenario represents a series of steps where messages can be sent, received, and checked.
func (*Scenario) Receive ¶
func (s *Scenario) Receive(checks ...ScenarioCheck) *Scenario
Receive creates a step where a message is received and then checked with the given checks.
type ScenarioCheck ¶
type ScenarioCheck func(msg hwebsocket.Msg) error
ScenarioCheck represents a function that is used to check a received message within a scenario.
Returning ErrScenarioMsgSkip skips the current message and the check will be reused on the next received message.
Any other returned error stops the scenario.
func FilterByRequestID ¶
func FilterByRequestID(v uint32) ScenarioCheck
FilterByRequestID is a check that skips every received message that does not have the given request id.
func FilterByType ¶
func FilterByType(types ...protoreflect.Enum) ScenarioCheck
FilterByType is a check that skips every received message that does not have one of the given types.
Click to show internal directories.
Click to hide internal directories.