{"id":17910118,"url":"https://github.com/austingebauer/go-fsm","last_synced_at":"2025-04-03T06:28:50.792Z","repository":{"id":57607302,"uuid":"183300354","full_name":"austingebauer/go-fsm","owner":"austingebauer","description":"A Go library that can be used to construct finite-state machines.","archived":false,"fork":false,"pushed_at":"2020-01-02T07:14:52.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-08T20:23:55.521Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/austingebauer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-24T20:15:16.000Z","updated_at":"2020-01-02T07:14:55.000Z","dependencies_parsed_at":"2022-08-30T05:23:15.544Z","dependency_job_id":null,"html_url":"https://github.com/austingebauer/go-fsm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fgo-fsm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fgo-fsm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fgo-fsm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austingebauer%2Fgo-fsm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austingebauer","download_url":"https://codeload.github.com/austingebauer/go-fsm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246946986,"owners_count":20859198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T19:29:15.291Z","updated_at":"2025-04-03T06:28:50.766Z","avatar_url":"https://github.com/austingebauer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-fsm [![GoReportCard](https://goreportcard.com/badge/github.com/austingebauer/go-fsm)](https://goreportcard.com/report/github.com/austingebauer/go-fsm) [![GoDoc](https://godoc.org/github.com/austingebauer/go-fsm?status.svg)](https://godoc.org/github.com/austingebauer/go-fsm)\n\nA golang library that can be used to construct finite-state machines.\n\nA finite-state machine is an abstract machine that can be in exactly one of a finite \nnumber of states at any given time.\n\nThe API and design of this library is inspired by the finite-state machine implementation \nin the [golang template lexer](https://github.com/golang/go/blob/master/src/text/template/parse/lex.go#L105).\n\n## Installation\n\nTo install `go-fsm`, use `go get`.\n\n```bash\ngo get github.com/austingebauer/go-fsm\n```\n\nThen import the library into your Go program.\n\n```go\nimport \"github.com/austingebauer/go-fsm\"\n```\n\n## Usage\n\nSee example usage in [example/main.go](./example/main.go), which uses go-fsm to write a \nfinite-state machine for the [pacman ghosts state machine](https://bits.theorem.co/images/posts/2015-01-21-state-design-pacman-fsm.png).\n\nTo run the example:\n```bash\ngo run example/main.go\n```\n\n### Generating a State Diagram\n\nTo generate a state diagram showing the states, transitions, and steps of the finite-state machine execution:\n```bash\ndot example/dot_graph.gv -T png \u003e example/dot_graph.png \u0026\u0026 open example/dot_graph.png\n```\n\nAn example image generated from running the example finite-state machine:\n\n![go-fsm finite-state-machine](./example/dot_graph.png)\n\n## Contributing\n\nPull requests are welcome. \n\nFor major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests along with changes.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustingebauer%2Fgo-fsm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustingebauer%2Fgo-fsm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustingebauer%2Fgo-fsm/lists"}