Skip to content

dpapathanasiou/go-statemachine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

An implementation of a finite state machine in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages