gofsm

gofsm is a command line tool that generates finite state machine for Go struct.
Usage
Usage: gofsm gen -p ./examples/transitions -s Order -f State -o order_fsm.go -t ./examples/transitions/transitions.json
--package, -p package where struct is located (default: default is current dir(.))
--struct, -s struct name
--field, -f state field of struct
--output, -o output file name (default: default srcdir/<struct>_fsm.go)
--transitions, -t path to file with transitions
--noGenerate, -g don't put //go:generate instruction to the generated code (default: false)
--graph-output, -a value path to transition graph file in dot format
This will generate finite state machine for struct Order with transitions defined in ./examples/transitions/transitions.json file.
Transition graph will be generated from transitions file and output will be in dot format
Install
Using go
go get -u github.com/MrEhbr/gofsm/cmd/gofsm
Download releases
https://github.com/MrEhbr/gofsm/releases
License
© 2020 [Alexey Burmistrov]
Licensed under the Apache License, Version 2.0 (LICENSE). See the COPYRIGHT file for more details.
SPDX-License-Identifier: Apache-2.0