{"id":13723486,"url":"https://github.com/kiishi/statemachine","last_synced_at":"2026-01-15T00:50:38.541Z","repository":{"id":48475306,"uuid":"210249740","full_name":"kiishi/statemachine","owner":"kiishi","description":"Simple library for implementing state machines","archived":false,"fork":false,"pushed_at":"2021-07-23T20:13:57.000Z","size":23,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T16:48:29.751Z","etag":null,"topics":["state","state-machine"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiishi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-23T02:37:39.000Z","updated_at":"2023-03-16T19:18:51.000Z","dependencies_parsed_at":"2022-08-24T07:50:44.281Z","dependency_job_id":null,"html_url":"https://github.com/kiishi/statemachine","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kiishi/statemachine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiishi%2Fstatemachine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiishi%2Fstatemachine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiishi%2Fstatemachine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiishi%2Fstatemachine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiishi","download_url":"https://codeload.github.com/kiishi/statemachine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiishi%2Fstatemachine/sbom","scorecard":{"id":559819,"data":{"date":"2025-08-11","repo":{"name":"github.com/kiishi/statemachine","commit":"40b33d5a010560c7a292e39b0979a6645983920e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/kiishi/statemachine/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/kiishi/statemachine/main.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T13:20:46.614Z","repository_id":48475306,"created_at":"2025-08-20T13:20:46.614Z","updated_at":"2025-08-20T13:20:46.614Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28440549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:34:46.850Z","status":"ssl_error","status_checked_at":"2026-01-15T00:34:46.551Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["state","state-machine"],"created_at":"2024-08-03T01:01:42.106Z","updated_at":"2026-01-15T00:50:38.524Z","avatar_url":"https://github.com/kiishi.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"## State Machine ![](https://github.com/kiishi/statemachine/workflows/CI/badge.svg)\nCool-ish state machine💅🏾\n\n### Simple Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\tmachine \"github.com/kiishi/statemachine\"\n)\n\ntype FoodState struct {\n\tname string\n}\n\nfunc (m *FoodState) GetIdentifier() string {\n\treturn m.name // name must be unique\n}\n\nfunc main() {\n\traw := FoodState{\"raw\"}\n\tcooked := FoodState{\"cooked\"}\n\t\n\tstatemachine := machine.NewMachine()\n\t\n\tstatemachine.AddState(\u0026raw) // this becomes the initial state \n\tstatemachine.AddState(\u0026cooked)\n\t\n\tstatemachine.AddTransition(\u0026machine.TransitionRule{\n\t\tEventName:        \"move\",\n\t\tCurrentState:     \u0026raw,\n\t\tDestinationState: \u0026cooked,\n\t})\n\t\n\terr := statemachine.Emit(\"move\")\n\tif err != nil {\n\t\t// handle error here\n\t\tpanic(err)\n\t}\n\n\t//\tvalidate\n\tfmt.Println(statemachine.GetCurrentState().GetIdentifier()) // outputs \"cooked\"\n\n}\n```\n\n### Not So Simple Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\tmachine \"github.com/kiishi/statemachine\"\n)\n\ntype FoodState struct {\n\tname string\n}\n\nfunc (m *FoodState) GetIdentifier() string {\n\treturn m.name // name must be unique\n}\n\nfunc main() {\n\traw := FoodState{\"raw\"}\n\tcooked := FoodState{\"cooked\"}\n\n\tstatemachine := machine.NewMachine(\n\t\t\u0026machine.Config{\n\t\t\tStates: []machine.State{\n\t\t\t\t\u0026raw, // first state is initial\n\t\t\t\t\u0026cooked,\n\t\t\t},\n\t\t\tTransitions: []*machine.TransitionRule{\n\t\t\t\t\u0026machine.TransitionRule{\n\t\t\t\t\tEventName:        \"cook\",\n\t\t\t\t\tCurrentState:     \u0026raw,\n\t\t\t\t\tDestinationState: \u0026cooked,\n\t\t\t\t\tOnTransition: func(\n\t\t\t\t\t\trule *machine.TransitionRule,\n\t\t\t\t\t\tnewState,\n\t\t\t\t\t\tpreviousState machine.State,\n\t\t\t\t\t) {\n\t\t\t\t\t\tfmt.Println(\"Food is ready\")\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\n\t//  run a transition\n\terr := statemachine.Emit(\"cook\")\n\tif err != nil {\n\t\t// handle error here\n\t\tpanic(err)\n\t}\n\n\t//\tvalidate\n\tfmt.Println(statemachine.GetCurrentState().GetIdentifier()) // outputs \"cooked\"\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiishi%2Fstatemachine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiishi%2Fstatemachine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiishi%2Fstatemachine/lists"}