{"id":19634910,"url":"https://github.com/rikonor/go-status-code-tracker","last_synced_at":"2025-08-02T01:33:07.535Z","repository":{"id":72775054,"uuid":"80267064","full_name":"rikonor/go-status-code-tracker","owner":"rikonor","description":"Tiny wrapper for ResponseWriter to track response status code","archived":false,"fork":false,"pushed_at":"2017-01-28T05:33:34.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-09T16:19:02.849Z","etag":null,"topics":["golang","http","status-code"],"latest_commit_sha":null,"homepage":null,"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/rikonor.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":"2017-01-28T04:49:04.000Z","updated_at":"2019-02-21T13:07:49.000Z","dependencies_parsed_at":"2023-02-28T00:01:54.069Z","dependency_job_id":null,"html_url":"https://github.com/rikonor/go-status-code-tracker","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/rikonor%2Fgo-status-code-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikonor%2Fgo-status-code-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikonor%2Fgo-status-code-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikonor%2Fgo-status-code-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rikonor","download_url":"https://codeload.github.com/rikonor/go-status-code-tracker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240941484,"owners_count":19882062,"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":["golang","http","status-code"],"created_at":"2024-11-11T12:23:11.113Z","updated_at":"2025-02-26T21:40:18.875Z","avatar_url":"https://github.com/rikonor.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Status Code Tracker\n---\n\nSmall utility for getting the status code of a finished http request.\n\n### Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/gorilla/mux\"\n\tstatus \"github.com/rikonor/go-status-code-tracker\"\n)\n\nfunc main() {\n\tr := mux.NewRouter()\n\tr.HandleFunc(\"/\", mainHandler)\n\thttp.Handle(\"/\", middleware(r))\n\thttp.ListenAndServe(\":8080\", nil)\n}\n\nfunc middleware(h http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\t// wrap the ResponseWriter with a StatusCodeTracker\n\t\tt := status.Track(w)\n\n\t\th.ServeHTTP(t, r)\n\n\t\t// Can now get the response status code\n\t\tfmt.Println(t.Status())\n\t})\n}\n\nfunc mainHandler(w http.ResponseWriter, r *http.Request) {\n\thttp.Error(w, \"error\", 400)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikonor%2Fgo-status-code-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frikonor%2Fgo-status-code-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikonor%2Fgo-status-code-tracker/lists"}