{"id":15323645,"url":"https://github.com/joeig/singleshot","last_synced_at":"2025-04-14T23:34:44.424Z","repository":{"id":42365685,"uuid":"432290188","full_name":"joeig/singleshot","owner":"joeig","description":"http.RoundTripper which deduplicates similar HTTP requests","archived":false,"fork":false,"pushed_at":"2025-03-19T15:14:35.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T11:39:39.179Z","etag":null,"topics":["go","roundtripper"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/go.eigsys.de/singleshot","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/joeig.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":"2021-11-26T20:09:20.000Z","updated_at":"2025-03-19T15:14:12.000Z","dependencies_parsed_at":"2023-11-06T07:45:50.714Z","dependency_job_id":"5906b288-2b42-474f-8342-d48c3657d869","html_url":"https://github.com/joeig/singleshot","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":0.5151515151515151,"last_synced_commit":"d0f61656320967f5ae3291a70e5c4280226c0b1b"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeig%2Fsingleshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeig%2Fsingleshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeig%2Fsingleshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeig%2Fsingleshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeig","download_url":"https://codeload.github.com/joeig/singleshot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248980293,"owners_count":21193131,"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","roundtripper"],"created_at":"2024-10-01T09:20:50.033Z","updated_at":"2025-04-14T23:34:44.418Z","avatar_url":"https://github.com/joeig.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Singleshot\n\nSingleshot provides an `http.RoundTripper` which deduplicates similar HTTP requests.\n\n[![Go Report Card](https://goreportcard.com/badge/go.eigsys.de/singleshot)](https://goreportcard.com/report/go.eigsys.de/singleshot)\n[![PkgGoDev](https://pkg.go.dev/badge/go.eigsys.de/singleshot)](https://pkg.go.dev/go.eigsys.de/singleshot)\n\nIf two similar HTTP requests are supposed to be sent concurrently, the first one will actually be sent to the server, while the second one waits until the first one was fulfilled completely.\nThe second request will never be sent to the server, but returns a copy of the response of the first request.\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant Server\n    \n    Client -\u003e\u003e +Server: Request 1\n    Note over Client: Identical, subsequent requests wait\u003cbr/\u003euntil Request 1 was fulfilled.\n    Client -\u003e Client: Request 2\n    Server --\u003e\u003e -Client: Response 1, Response 2\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"go.eigsys.de/singleshot\"\n)\n\nfunc main() {\n\t_ = http.Client{\n\t\tTransport: singleshot.NewTransport(http.DefaultTransport),\n\t}\n}\n```\n\n## Notes\n\n* Always apply proper timeouts or use requests with contexts, otherwise one request which is timing out may stop subsequent requests from being retried.\n* Requests are considered deduplicatable, if they share the same HTTP method and request URI. Furthermore, the method has to be `GET` and the request must not be a `range` request. The body is ignored according to [RFC 2616, section 9.3](https://www.rfc-editor.org/rfc/rfc2616#section-9.3).\n\n## Documentation\n\nSee [pkg.go.dev](https://pkg.go.dev/go.eigsys.de/singleshot).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeig%2Fsingleshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeig%2Fsingleshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeig%2Fsingleshot/lists"}