{"id":36700942,"url":"https://github.com/exaring/hoglet","last_synced_at":"2026-01-12T11:38:09.259Z","repository":{"id":143000752,"uuid":"611916846","full_name":"exaring/hoglet","owner":"exaring","description":"Simple low-overhead circuit breaker library for go","archived":false,"fork":false,"pushed_at":"2025-12-19T13:47:54.000Z","size":110,"stargazers_count":17,"open_issues_count":2,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-12-22T05:36:52.504Z","etag":null,"topics":["circuit-breaker","golang","library"],"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/exaring.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,"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":"2023-03-09T20:07:35.000Z","updated_at":"2025-12-12T20:17:49.000Z","dependencies_parsed_at":"2023-11-14T15:46:36.946Z","dependency_job_id":"f4528f2b-a776-4cce-90b0-103ea9492052","html_url":"https://github.com/exaring/hoglet","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/exaring/hoglet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exaring%2Fhoglet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exaring%2Fhoglet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exaring%2Fhoglet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exaring%2Fhoglet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exaring","download_url":"https://codeload.github.com/exaring/hoglet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exaring%2Fhoglet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["circuit-breaker","golang","library"],"created_at":"2026-01-12T11:38:09.197Z","updated_at":"2026-01-12T11:38:09.250Z","avatar_url":"https://github.com/exaring.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/exaring/hoglet/actions/workflows/main.yaml/badge.svg)](https://github.com/exaring/hoglet/actions/workflows/main.yaml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/exaring/hoglet.svg)](https://pkg.go.dev/github.com/exaring/hoglet)\n[![Go Report Card](https://goreportcard.com/badge/github.com/exaring/hoglet)](https://goreportcard.com/report/github.com/exaring/hoglet)\n\n# hoglet\n\nSimple low-overhead circuit breaker library.\n\n## Usage\n\n```go\n// some arbitrary function\nfoo := func(ctx context.Context, bar int) (Foo, error) {\n    if bar == 42 {\n        return Foo{Bar: bar}, nil\n    }\n    return Foo{}, fmt.Errorf(\"bar is not 42\")\n}\n\nh, err := hoglet.NewCircuit(\n    hoglet.NewSlidingWindowBreaker(5*time.Second, 0.1),\n    hoglet.WithFailureCondition(hoglet.IgnoreContextCanceled),\n)\n/* if err != nil ... */\n\nf, _ := hoglet.Wrap(h, foo)(context.Background(), 42)\nfmt.Println(f.Bar) // 42\n\n_, err = hoglet.Wrap(h, foo)(context.Background(), 0)\nfmt.Println(err) // bar is not 42\n\n_, err = hoglet.Wrap(h, foo)(context.Background(), 42)\nfmt.Println(err) // hoglet: breaker is open\n\ntime.Sleep(5 * time.Second)\n\nf, _ = hoglet.Wrap(h, foo)(context.Background(), 42)\nfmt.Println(f.Bar) // 42\n```\n\n## Operation\n\nEach call to the wrapped function (via `Circuit.Call`) is tracked and its result \"observed\". Breakers then react to\nthese observations according to their own logic, optionally opening the circuit.\n\nAn open circuit does not allow any calls to go through, and will return an error immediately.\n\nIf the wrapped function blocks, `Circuit.Call` will block as well, but any context cancellations or expirations will\ncount towards the failure rate, allowing the circuit to respond timely to failures, while still having well-defined and\nnon-racy behavior around the failed function.\n\n\n## Design\n\nHoglet prefers throughput to correctness (e.g. by avoiding locks), which means it cannot guarantee an exact number of\ncalls will go through.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexaring%2Fhoglet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexaring%2Fhoglet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexaring%2Fhoglet/lists"}