{"id":30044704,"url":"https://github.com/tomiok/clipper","last_synced_at":"2025-08-07T06:45:18.616Z","repository":{"id":64302909,"uuid":"358497012","full_name":"tomiok/clipper","owner":"tomiok","description":"Clipper is an plug-and-play, easy to use circuit breaker library. Based on Netflix Hystrix. Give a try for fast, secure and a non-dependency piece of software. ","archived":false,"fork":false,"pushed_at":"2021-12-11T06:44:51.000Z","size":38,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T03:43:27.369Z","etag":null,"topics":["circuit-breaker","go","golang","hystrix-based","library","microservices","pattern"],"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/tomiok.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":"2021-04-16T06:21:51.000Z","updated_at":"2022-12-28T22:14:39.000Z","dependencies_parsed_at":"2022-12-06T07:30:33.598Z","dependency_job_id":null,"html_url":"https://github.com/tomiok/clipper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tomiok/clipper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomiok%2Fclipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomiok%2Fclipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomiok%2Fclipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomiok%2Fclipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomiok","download_url":"https://codeload.github.com/tomiok/clipper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomiok%2Fclipper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269213683,"owners_count":24379498,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","go","golang","hystrix-based","library","microservices","pattern"],"created_at":"2025-08-07T06:45:14.635Z","updated_at":"2025-08-07T06:45:18.583Z","avatar_url":"https://github.com/tomiok.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clipper - circuit breaker\n\n### Lightweight circuit breaker tool, inspired in hystrix from Netflix.\n\n\n----\n\nThis is a simple, dependency free, circuit breaker library. Super easy to use.\nYou could find also some basic statistics and a handler according to the std lib to expose, given the name of the\ncommand.\n\n\n```go\nclipper.Do(\u0026clipper.Configs{Name: \"my_command\"}, func() error {\n\t\t_, err := http.Get(\"http://www.google.com/robots.txt\")\n\t\treturn err\n\t}, nil)\n```\nDo use 3 args,\n1. The Config\n2. Operational function\n3. Fallback function\n\nAnd in this case you also have 2 different ways to call the clipper , sync and async, could check out in the \nexamples folder.\n\nThe config should have the name and the max duration expressed in seconds.\nThe Function to operate,.\nThe fallback function, is not necessary at all.\n\n### Wait the response\n```go\nout := make(chan bool, 1)\n\tvar res *http.Response\n\tvalChan := clipper.Do(\u0026clipper.Configs{Name: \"my_command\"}, func() error {\n\t\tr, err := http.Get(\"http://www.google.com/robots.txt\")\n\t\tres = r\n\t\tout \u003c- true\n\t\treturn err\n\t}, nil)\n\n\tselect {\n\tcase \u003c-out:\n\t\tvalue := \u003c-valChan\n\t\tif value == 0 {\n\t\t\tfmt.Println(\"no errors\")\n\t\t} else {\n\t\t\tfmt.Println(\"some errors here\")\n\t\t}\n\t}\n\tfmt.Println(res)\n```\n\n### No wait to the response\n```go\nclipper.Do(\u0026clipper.Configs{Name: \"my_command\"}, func() error {\n\t\tr, err := http.Get(\"http://www.google.com/robots.txt\")\n\t\tres = r\n\t\treturn err\n\t}, nil)\n\n\tclipper.FillStats(\"my_command\", true)\n```\n\n### Web\nCheck the function `ExposeMetrics()` and get all the metrics info. You must provide a valid command name. In the \nURL like: \n`localhost:8080/metrics?c=my_command`\n\n--- \n### Tests\n\n```shell\ngo test -v .\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomiok%2Fclipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomiok%2Fclipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomiok%2Fclipper/lists"}