This project demonstrates the use of stateless, an implementation of state machines in Go.
This is a modified version of the original example which uses an external storage for storing the states.
type LogRepository struct {
...
phoneLogs map[PhoneID][]Log
}
This is a very simple in-memory store. But in reality, this external storage can be a real database (e.g. Postgres, MariaDB, etc.)
To run the example just run the command below:
$ go build -v -o phonestates && ./phonestates