Versions in this module Expand all Collapse all v0 v0.1.2 Nov 19, 2024 v0.1.0 Nov 19, 2024 Changes in this version + type BaseState struct + Transitions map[string]func(T) State[T] + func (s *BaseState[T]) Enter(data T) + func (s *BaseState[T]) Exit(data T) + func (s *BaseState[T]) Handle(event string, data T) (State[T], bool) + type RunningState struct + func NewRunningState[T any]() *RunningState[T] + type StartState struct + func NewStartState[T any]() *StartState[T] + type State interface + Enter func(data T) + Exit func(data T) + Handle func(event string, data T) (State[T], bool) + type StateMachine struct + CurrentState State[T] + Data T + func NewStateMachine[T any](initialState State[T], data T) *StateMachine[T] + func (sm *StateMachine[T]) Transition(event string) + type StoppedState struct + func NewStoppedState[T any]() *StoppedState[T]