{"id":19420102,"url":"https://github.com/einride/supervisor-go","last_synced_at":"2026-02-28T10:31:08.900Z","repository":{"id":36970125,"uuid":"199019009","full_name":"einride/supervisor-go","owner":"einride","description":"A service that starts and supervises other services and restarts them in case of failure.","archived":false,"fork":false,"pushed_at":"2025-12-01T08:40:33.000Z","size":191,"stargazers_count":22,"open_issues_count":0,"forks_count":4,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-12-03T19:56:27.478Z","etag":null,"topics":["actors","go","golang","supervision","supervisor"],"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/einride.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-07-26T13:12:17.000Z","updated_at":"2025-12-01T08:40:36.000Z","dependencies_parsed_at":"2024-02-13T15:06:13.853Z","dependency_job_id":"43f32f9b-03c1-4747-9e6d-50d78c558048","html_url":"https://github.com/einride/supervisor-go","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/einride/supervisor-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fsupervisor-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fsupervisor-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fsupervisor-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fsupervisor-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/einride","download_url":"https://codeload.github.com/einride/supervisor-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fsupervisor-go/sbom","scorecard":{"id":370079,"data":{"date":"2025-08-11","repo":{"name":"github.com/einride/supervisor-go","commit":"df9f4be3bbd2b061c8890ceb7f11e90890632059"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6,"checks":[{"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":"Maintained","score":6,"reason":"8 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: topLevel permissions set to 'write-all': .github/workflows/release.yml:5"],"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":"Code-Review","score":-1,"reason":"Found no human activity in the last 30 changesets","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":"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":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/einride/supervisor-go/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/einride/supervisor-go/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/einride/supervisor-go/release.yml/master?enable=pin","Info:   0 out of   3 third-party 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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":5,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: 'stale review dismissal' is disabled on branch 'master'","Warn: required approving review count is 1 on branch 'master'","Warn: codeowners review is not required on branch 'master'","Warn: 'last push approval' is disabled on branch 'master'","Warn: no status checks found to merge onto branch 'master'","Info: PRs are required in order to make changes on 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":-1,"reason":"internal error: internal error: Client.Checks.ListCheckRunsForRef: error during graphqlHandler.setupCheckRuns: non-200 OK status code: 502 Bad Gateway body: \"\u003chtml\u003e\\r\\n\u003chead\u003e\u003ctitle\u003e502 Bad Gateway\u003c/title\u003e\u003c/head\u003e\\r\\n\u003cbody\u003e\\r\\n\u003ccenter\u003e\u003ch1\u003e502 Bad Gateway\u003c/h1\u003e\u003c/center\u003e\\r\\n\u003chr\u003e\u003ccenter\u003enginx\u003c/center\u003e\\r\\n\u003c/body\u003e\\r\\n\u003c/html\u003e\\r\\n\"","details":null,"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-18T12:44:39.167Z","repository_id":36970125,"created_at":"2025-08-18T12:44:39.167Z","updated_at":"2025-08-18T12:44:39.167Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29930344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["actors","go","golang","supervision","supervisor"],"created_at":"2024-11-10T13:21:04.958Z","updated_at":"2026-02-28T10:31:08.876Z","avatar_url":"https://github.com/einride.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go.einride.tech/supervisor\n\nA service that manages service lifetimes.\n\nA supervisor is essentially a more capable errgroup. It monitors a set of\nrunning services, and restarts them if they fail. The supervisor keeps track of\nthe status of each service and reports any status changes to listeners via a\ncallback.\n\n## Examples\n\n### Supervising multiple services\n\nJust as with errgroups, a supervisor can manage multiple services.\n\n```go\nfunc ExampleSupervisor() {\n\t// Restart stopped services every 10ms.\n\tcfg := supervisor.Config{\n\t\tRestartInterval: 10 * time.Millisecond,\n\t\t// No specified clock returns system clock\n\t\t// No specified logger returns a nop-logger\n\t}\n\t// Create a context which can be canceled.\n\tctx, cancel := context.WithTimeout(context.Background(), time.Second)\n\t// Create pingpong table\n\ttable := make(chan int)\n\troundsToPlay := 2\n\t// Create player services.\n\tpingService := supervisor.NewService(\"ping\", func(ctx context.Context) error {\n\t\ti := roundsToPlay\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase \u003c-ctx.Done():\n\t\t\t\treturn fmt.Errorf(\"timeout\")\n\t\t\tcase table \u003c- i:\n\t\t\t\tfmt.Println(\"ping\")\n\t\t\t\ti = \u003c-table\n\t\t\t\tif i == 0 {\n\t\t\t\t\tclose(table)\n\t\t\t\t\tcancel()\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t})\n\tpongService := supervisor.NewService(\"pong\", func(ctx context.Context) error {\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase \u003c-ctx.Done():\n\t\t\t\treturn fmt.Errorf(\"timeout\")\n\t\t\tcase i := \u003c-table:\n\t\t\t\tif i == 0 {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\ttable \u003c- i - 1\n\t\t\t\tfmt.Println(\"pong\")\n\t\t\t}\n\t\t}\n\t})\n\t// Add service to the supervised services.\n\tcfg.Services = append(cfg.Services, pingService, pongService)\n\t// Create the supervisor from the config.\n\ts := supervisor.New(\u0026cfg)\n\t// Run the supervisor (blocking call).\n\terr := s.Run(ctx)\n\tif err != nil {\n\t\t// handle error\n\t\tpanic(err)\n\t}\n\tdefer cancel()\n\t// Output:\n\t// ping\n\t// pong\n\t// ping\n\t// pong\n}\n```\n\n### Restarting crashed services\n\nThe main difference from errgroups is that a supervisor will restart a crashed\nservice.\n\n```go\nfunc ExampleRestartOnError() {\n\t// Restart stopped services every 10ms.\n\tcfg := supervisor.Config{\n\t\tRestartInterval: 10 * time.Millisecond,\n\t}\n\tctx, cancel := context.WithCancel(context.Background())\n\tstarts := 0\n\tsvc := supervisor.NewService(\"example\", func(ctx context.Context) error {\n\t\tstarts++\n\t\tif starts \u003e 3 {\n\t\t\tcancel()\n\t\t\treturn nil\n\t\t}\n\t\treturn fmt.Errorf(\"oops\")\n\t})\n\tcfg.Services = append(cfg.Services, svc)\n\ts := supervisor.New(\u0026cfg)\n\tif err := s.Run(ctx); err != nil {\n\t\t// no error currently returned\n\t}\n\tfmt.Println(\"service restarted\", starts, \"times\")\n\t// Output:\n\t// service restarted 3 times\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feinride%2Fsupervisor-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feinride%2Fsupervisor-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feinride%2Fsupervisor-go/lists"}