{"id":15452007,"url":"https://github.com/willscott/go-requestcontext","last_synced_at":"2025-03-31T05:45:52.028Z","repository":{"id":192576394,"uuid":"669053102","full_name":"willscott/go-requestcontext","owner":"willscott","description":"keep a request id on a context","archived":false,"fork":false,"pushed_at":"2023-07-21T08:26:45.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-06T10:19:50.979Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willscott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-07-21T08:26:05.000Z","updated_at":"2023-07-21T08:26:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"736780ee-0713-487a-b900-2b5860d6e315","html_url":"https://github.com/willscott/go-requestcontext","commit_stats":null,"previous_names":["willscott/go-requestcontext"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgo-requestcontext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgo-requestcontext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgo-requestcontext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgo-requestcontext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willscott","download_url":"https://codeload.github.com/willscott/go-requestcontext/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246423727,"owners_count":20774819,"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-01T21:40:48.117Z","updated_at":"2025-03-31T05:45:52.012Z","avatar_url":"https://github.com/willscott.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-requestcontext\n\nThis repo provides a small shim for tagging a request ID onto the request context, and then get access to that request ID in sub-contexts.\n\nThe impetus for this code is that the setting and use of the request ID context key may be in different projects, and it may be desirable to decouple the dependency between such projects. Since context keys are advisted to be set using a custom sentinal type, this repo provides the place for that singleton value to live.\n\n## Usage\n\n```go\nimport (\n    \"context\"\n    \"net/http\"\n\n    requestcontext \"github.com/willscott/go-requestcontext\"\n)\n\nfunc main() {\n    // Injection\n    mux := http.NewServeMux()\n    handler := requestcontext.Middleware(mux, \"X-RequestID\")\n    ...\n}\n\nfunc sendSubrequest(ctx context.Context) {\n    rid := requestcontext.IDFromContext(ctx)\n    ...\n}\n\n```\n\n## Documentation\n\nSee [godoc](https://godoc.org/github.com/willscott/go-requestcontext) for API documentation.\n\n\n## Contributing\n\nContributions are welcome! This repository is part of the IPFS project and therefore governed by our [contributing guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md).\n\n## License\n\n[SPDX-License-Identifier: Apache-2.0 OR MIT](LICENSE.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillscott%2Fgo-requestcontext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillscott%2Fgo-requestcontext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillscott%2Fgo-requestcontext/lists"}