Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dpapathanasiou/go-statemachine
An implementation of a finite state machine in Go
https://github.com/dpapathanasiou/go-statemachine
Last synced: about 2 months ago
JSON representation
An implementation of a finite state machine in Go
- Host: GitHub
- URL: https://github.com/dpapathanasiou/go-statemachine
- Owner: dpapathanasiou
- License: mit
- Created: 2013-02-09T22:36:39.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-05-03T18:14:25.000Z (over 11 years ago)
- Last Synced: 2024-06-18T22:25:41.492Z (7 months ago)
- Language: Go
- Size: 97.7 KB
- Stars: 106
- Watchers: 6
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-statemachine
===============About
-----This package provides an implementation of a finite state machine in Go (http://golang.org/), inspired by David Mertz's article "Charming Python: Using state machines" (http://www.ibm.com/developerworks/library/l-python-state/index.html).
Usage
-----Install the package in your environment:
```
$ go get github.com/dpapathanasiou/go-statemachine
```Make sure the GOPATH environment variable is defined correctly and test it:
```
$ go test github.com/dpapathanasiou/go-statemachine
ok github.com/dpapathanasiou/go-statemachine 0.014s
```To use it within your own code, import "github.com/dpapathanasiou/go-statemachine" and instantiate the state machine with an empty map of handler functions, along with the string name of the initial state handler function.
Example
-------See the statemachine_test.go file included in this package.