{"id":13764078,"url":"https://github.com/percolate/retry","last_synced_at":"2025-04-18T15:03:10.493Z","repository":{"id":57494020,"uuid":"137524281","full_name":"percolate/retry","owner":"percolate","description":"Percolate's Go retry package","archived":false,"fork":false,"pushed_at":"2023-03-16T18:34:48.000Z","size":173,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-03-29T06:23:17.063Z","etag":null,"topics":["go","retry"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/percolate.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}},"created_at":"2018-06-15T19:23:36.000Z","updated_at":"2023-12-18T01:26:00.000Z","dependencies_parsed_at":"2024-06-21T05:44:53.126Z","dependency_job_id":"6b9f3f1d-36e4-49ef-b2b1-357bcef71886","html_url":"https://github.com/percolate/retry","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/percolate%2Fretry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percolate%2Fretry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percolate%2Fretry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/percolate%2Fretry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/percolate","download_url":"https://codeload.github.com/percolate/retry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249509324,"owners_count":21283566,"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":["go","retry"],"created_at":"2024-08-03T15:01:12.318Z","updated_at":"2025-04-18T15:03:10.475Z","avatar_url":"https://github.com/percolate.png","language":"Shell","readme":"# ReTry\n\n[![circleci](https://circleci.com/gh/percolate/retry.svg?style=shield\u0026circle-token=:circle-token)](https://circleci.com/gh/percolate/retry)\n[![codecov](https://codecov.io/gh/percolate/retry/branch/master/graph/badge.svg?token=p3WLUQEQqf)](https://codecov.io/gh/percolate/retry)\n\nPercolate's Go retry package\n\n## Description\n\nReTry is a simple Go package for implementing retry logic. It's partially based\non the Python package, [retry](https://github.com/invl/retry).\n\n## Installation\n\n`go get github.com/percolate/retry`\n\n## Usage\n\nIt's easy! Configure an instance of `Re` to your liking, and pass its `Try`\nmethod a `Func` of your choosing.\n\n## Example\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"io/ioutil\"\n    \"net/http\"\n    \"time\"\n\n    \"github.com/percolate/retry\"\n)\n\nfunc main() {\n\n    url := \"http://example.com\"\n    delay := time.Duration(10*time.Millisecond)\n\n    var body []byte\n    err := retry.Re{Max: 3, Delay: delay}.Try(func() error {\n        resp, err := http.Get(url)\n        if err != nil {\n            return err\n        }\n\n        defer resp.Body.Close()\n        body, err = ioutil.ReadAll(resp.Body)\n        if err != nil {\n            return err\n        }\n\n        return nil\n    })\n\n    if err != nil {\n        fmt.Println(err)\n    }\n    fmt.Println(body)\n}\n```","funding_links":[],"categories":["Utilities","公用事业公司","工具库`可以提升效率的通用代码库和工具`","Utility","工具库"],"sub_categories":["Utility/Miscellaneous","HTTP Clients","实用程序/Miscellaneous","Fail injection","查询语","交流"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercolate%2Fretry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpercolate%2Fretry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercolate%2Fretry/lists"}