Skip to content

agmt/go-msm

Repository files navigation

go-msm

A safe, persistent, and extensible Finite State Machine (FSM) library for Go, inspired by Boost MSM.

Overview

go-msm provides a framework for building robust FSMs in Go, focusing on:

  • Safety: Type-safe transitions, guards, and actions.
  • Persistence: All FSM states and transitions are stored in a database (via GORM), enabling recovery, replay, and audit.
  • Extensibility: Supports plugins, callbacks, and custom storage for advanced use cases.
  • Not performance-oriented: Unlike Boost MSM, this library prioritizes reliability and traceability over performance.

Features

  • Define states, events, actions, and guards with type safety.
  • Persist FSM state and transition history in a database (SQLite, PostgreSQL, etc. via GORM).
  • Replay FSM history for debugging or recovery.
  • Visualize FSMs using Graphviz.
  • Plugin system for custom event processing.
  • Callback system for logging, auditing, and side effects.

Getting Started

Installation

Add to your Go project:

go get github.com/agmt/go-msm

Basic Usage

ToDo

Examples

See the msm_test.go for a minimal working FSM.

Best Practices

ToDo

License

MIT

Acknowledgements

Inspired by Boost MSM.

About

FSM library for Go with DB persistence

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages