{"id":13764069,"url":"https://github.com/rafaeljesus/retry-go","last_synced_at":"2025-04-27T20:32:46.817Z","repository":{"id":57480565,"uuid":"93875831","full_name":"rafaeljesus/retry-go","owner":"rafaeljesus","description":"Retrying made simple and easy for golang :repeat: ","archived":false,"fork":false,"pushed_at":"2018-10-25T12:14:03.000Z","size":8,"stargazers_count":50,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T03:12:42.660Z","etag":null,"topics":["distributed-systems","go","resiliency"],"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/rafaeljesus.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":"2017-06-09T16:07:37.000Z","updated_at":"2024-09-19T15:39:41.000Z","dependencies_parsed_at":"2022-09-26T17:41:15.679Z","dependency_job_id":null,"html_url":"https://github.com/rafaeljesus/retry-go","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaeljesus%2Fretry-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaeljesus%2Fretry-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaeljesus%2Fretry-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaeljesus%2Fretry-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafaeljesus","download_url":"https://codeload.github.com/rafaeljesus/retry-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251204641,"owners_count":21552257,"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":["distributed-systems","go","resiliency"],"created_at":"2024-08-03T15:01:11.839Z","updated_at":"2025-04-27T20:32:46.574Z","avatar_url":"https://github.com/rafaeljesus.png","language":"Go","funding_links":[],"categories":["Utilities","工具库","公用事业公司","Utility","工具库`可以提升效率的通用代码库和工具`","实用工具"],"sub_categories":["Utility/Miscellaneous","查询语","HTTP Clients","Advanced Console UIs","实用程序/Miscellaneous","交流","Fail injection"],"readme":"# retry-go\n\n* Retrying made simple and easy for golang.\n\n## Installation\n```bash\ngo get -u github.com/rafaeljesus/retry-go\n```\n\n## Usage\n\n### Do\n```go\npackage main\n\nimport (\n  \"time\"\n\n  \"github.com/rafaeljesus/retry-go\"\n)\n\nfunc main() {\n  attempts := 3\n  sleepTime := time.Second*2\n  if err := retry.Do(func() error {\n    return work()\n  }, attempts, sleepTime); err != nil {\n    // Retry failed\n  }\n}\n```\n\n### DoHTTP\n```go\npackage main\n\nimport (\n  \"time\"\n\n  \"github.com/rafaeljesus/retry-go\"\n)\n\nfunc main() {\n  attempts := 3\n  sleepTime := time.Second*2\n  if err := retry.DoHTTP(func() (*http.Response, error) {\n    return makeRequest()\n  }, attempts, sleepTime); err != nil {\n    // Retry failed\n  }\n}\n```\n\n## Contributing\n- Fork it\n- Create your feature branch (`git checkout -b my-new-feature`)\n- Commit your changes (`git commit -am 'Add some feature'`)\n- Push to the branch (`git push origin my-new-feature`)\n- Create new Pull Request\n\n## Badges\n\n[![Build Status](https://circleci.com/gh/rafaeljesus/retry-go.svg?style=svg)](https://circleci.com/gh/rafaeljesus/retry-go)\n[![Go Report Card](https://goreportcard.com/badge/github.com/rafaeljesus/retry-go)](https://goreportcard.com/report/github.com/rafaeljesus/retry-go)\n[![Go Doc](https://godoc.org/github.com/rafaeljesus/retry-go?status.svg)](https://godoc.org/github.com/rafaeljesus/retry-go)\n\n---\n\n\u003e GitHub [@rafaeljesus](https://github.com/rafaeljesus) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e Medium [@_jesus_rafael](https://medium.com/@_jesus_rafael) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e Twitter [@_jesus_rafael](https://twitter.com/_jesus_rafael)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaeljesus%2Fretry-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaeljesus%2Fretry-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaeljesus%2Fretry-go/lists"}