{"id":16824916,"url":"https://github.com/tomnomnom/gahttp","last_synced_at":"2025-03-22T03:31:48.477Z","repository":{"id":41271441,"uuid":"147077187","full_name":"tomnomnom/gahttp","owner":"tomnomnom","description":"Async / concurrent HTTP requests for Go","archived":false,"fork":false,"pushed_at":"2023-06-29T09:54:52.000Z","size":8,"stargazers_count":50,"open_issues_count":3,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T07:51:31.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomnomnom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09-02T10:57:35.000Z","updated_at":"2025-01-21T15:11:12.000Z","dependencies_parsed_at":"2024-06-18T18:37:22.128Z","dependency_job_id":"a7a1f464-e75e-4dcd-8560-479c08cfb0f9","html_url":"https://github.com/tomnomnom/gahttp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fgahttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fgahttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fgahttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomnomnom%2Fgahttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomnomnom","download_url":"https://codeload.github.com/tomnomnom/gahttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244902929,"owners_count":20529114,"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":[],"created_at":"2024-10-13T11:12:25.173Z","updated_at":"2025-03-22T03:31:48.136Z","avatar_url":"https://github.com/tomnomnom.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gahttp\n\nAsync/concurrent HTTP requests for Go with rate-limiting.\n\nWork in progress.\n\n\n## Example\n\n```golang\npackage main\n\nimport (\n    \"fmt\"\n    \"net/http\"\n    \"time\"\n\n    \"github.com/tomnomnom/gahttp\"\n)\n\nfunc printStatus(req *http.Request, resp *http.Response, err error) {\n    if err != nil {\n        return\n    }\n    fmt.Printf(\"%s: %s\\n\", req.URL, resp.Status)\n}\n\nfunc main() {\n    p := gahttp.NewPipeline()\n    p.SetConcurrency(20)\n    p.SetRateLimit(time.Second * 1)\n\n    urls := []string{\n        \"http://example.com\",\n        \"http://example.com\",\n        \"http://example.com\",\n        \"http://example.net\",\n        \"http://example.org\",\n    }\n\n    for _, u := range urls {\n        p.Get(u, gahttp.Wrap(printStatus, gahttp.CloseBody))\n    }\n    p.Done()\n\n    p.Wait()\n}\n```\n\n## TODO\n\n* `DoneAndWait()` func?\n* Helper for writing responses to channel? (e.g. `func ChanWriter() (chan *Response, procFn)`)\n    - For when you don't want to do the work concurrently\n* Actually handle timeouts / provide context interface for cancellation etc?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomnomnom%2Fgahttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomnomnom%2Fgahttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomnomnom%2Fgahttp/lists"}