fsm: add event context to notification struct

This commit is contained in:
Slyghtning 2024-10-16 20:39:11 +02:00
parent 0ab40fe5d0
commit 93413ffbbb
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -76,6 +76,8 @@ type Notification struct {
NextState StateType
// Event is the event that was processed.
Event EventType
// EventContext is the event context that was processed.
EventContext EventContext
// LastActionError is the error returned by the last action executed.
LastActionError error
}
@ -222,6 +224,7 @@ func (s *StateMachine) SendEvent(event EventType, eventCtx EventContext) error {
PreviousState: s.previous,
NextState: s.current,
Event: event,
EventContext: eventCtx,
LastActionError: s.LastActionError,
}