Categorygithub.com/smlx/fsm
modulepackage
0.2.1
Repository: https://github.com/smlx/fsm.git
Documentation: pkg.go.dev

# README

Finite State Machine

Tag and Release Coverage Status Go Reference

The fsm module implements a minimal finite state machine.

I used this logic in multiple projects, so I decided I may as well publish it. Honestly, this module is so simple you might be better off just copying the logic instead of importing it.

A little copying is better than a little dependency.

Usage

See the Go reference link above.

# Structs

Machine represents a finite state machine (FSM).
Transition represents a transition that the FSM can make between states.
UnexpectedEventError is an error type that exposes the event/state that caused the error.

# Type aliases

Event represents an event that can occur which may cause a state transition.
State represents a state that the FSM can be in.
A TransitionFunc handles an event during a state transition.