Versions in this module Expand all Collapse all v1 v1.0.3 Oct 8, 2022 v1.0.2 Mar 22, 2022 v1.0.1 Jul 29, 2021 v1.0.0 Jul 28, 2021 Changes in this version + var ErrTerminated = xerrors.New("normal shutdown of state machine") + type Context struct + func (ctx *Context) Context() context.Context + func (ctx *Context) Send(evt interface{}) error + type Event struct + User interface{} + type Planner func(events []Event, user interface{}) (interface{}, uint64, error) + type StateGroup struct + func New(ds datastore.Datastore, hnd StateHandler, stateType interface{}) *StateGroup + func (s *StateGroup) Begin(id interface{}, userState interface{}) error + func (s *StateGroup) Get(id interface{}) *statestore.StoredState + func (s *StateGroup) Has(id interface{}) (bool, error) + func (s *StateGroup) List(out interface{}) error + func (s *StateGroup) Send(id interface{}, evt interface{}) (err error) + func (s *StateGroup) Stop(ctx context.Context) error + type StateHandler interface + Plan func(events []Event, user interface{}) (interface{}, uint64, error) + type StateHandlerWithInit interface + Init func(<-chan struct{}) + type StateMachine struct + type TestEvent struct + A string + Val uint64 + func (t *TestEvent) MarshalCBOR(w io.Writer) error + func (t *TestEvent) UnmarshalCBOR(r io.Reader) error + type TestState struct + A uint64 + B uint64 + C []uint64 + func (t *TestState) MarshalCBOR(w io.Writer) error + func (t *TestState) UnmarshalCBOR(r io.Reader) error