{"id":19809520,"url":"https://github.com/space-code/go-middlewares","last_synced_at":"2025-09-14T16:10:21.751Z","repository":{"id":205124177,"uuid":"711945674","full_name":"space-code/go-middlewares","owner":"space-code","description":"go-middlewares is a collection of commonly used middlewares in Go.","archived":false,"fork":false,"pushed_at":"2023-11-13T17:37:21.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-02-28T18:25:21.621Z","etag":null,"topics":["go","golang","middleware","middlewares"],"latest_commit_sha":null,"homepage":"","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/space-code.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-10-30T13:45:48.000Z","updated_at":"2023-11-02T16:43:29.000Z","dependencies_parsed_at":"2023-11-13T18:37:04.008Z","dependency_job_id":null,"html_url":"https://github.com/space-code/go-middlewares","commit_stats":null,"previous_names":["space-code/go-middlewares"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/space-code/go-middlewares","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Fgo-middlewares","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Fgo-middlewares/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Fgo-middlewares/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Fgo-middlewares/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/space-code","download_url":"https://codeload.github.com/space-code/go-middlewares/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Fgo-middlewares/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275129123,"owners_count":25410418,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","golang","middleware","middlewares"],"created_at":"2024-11-12T09:17:15.396Z","updated_at":"2025-09-14T16:10:21.728Z","avatar_url":"https://github.com/space-code.png","language":"Go","readme":"\u003ch1 align=\"center\" style=\"margin-top: 0px;\"\u003ego-middlewares\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/space-code/go-middlewares/blob/main/LICENSE\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-MIT-yellow.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/space-code/go-middlewares\"\u003e\u003cimg alt=\"CI\" src=\"https://github.com/space-code/go-middlewares/actions/workflows/ci.yml/badge.svg?branch=main\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Description\n`go-middlewares` is a collection of commonly used middlewares in Go.\n\n- [Usage](#usage)\n- [Installation](#installation)\n- [Communication](#communication)\n- [Contributing](#contributing)\n- [Author](#author)\n- [License](#license)\n\n## Usage\n\n1. The `ErrorHandlerMiddleware` is a middleware function designed to handle panics and errors that may occur during the execution of an HTTP handler.\n\nHere's an example of how to use it in your code:\n\n```go\n// Create a new HTTP handler and wrap it with the ErrorHandlerMiddleware.\nhandler := ErrorHandlerMiddleware(yourHandler)\n\n// Use the wrapped handler for your server.\nhttp.Handle(\"/your-route\", handler)\n\n// Start your HTTP server.\nhttp.ListenAndServe(\":8080\", nil)\n```\n\n2. The `LogHandlerMiddleware` is designed to log HTTP requests made to your web application. It captures various details about the request and logs them to your preferred output, which is especially useful for debugging and monitoring.\n\n```go\n// Create a new HTTP handler and wrap it with the LogHandlerMiddleware.\nhandler := LogHandlerMiddleware(yourHandler)\n\n// Use the wrapped handler for your HTTP server.\nhttp.Handle(\"/your-route\", handler)\n\n// Start your HTTP server.\nhttp.ListenAndServe(\":8080\", nil)\n```\n\n## Installation\n\n```\ngo get github.com/space-code/go-middleware\n```\n\n## Communication\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n## Contributing\n\nPlease feel free to help out with this project! If you see something that could be made better or want a new feature, open up an issue or send a Pull Request!\n\n## Author\nNikita Vasilev, nv3212@gmail.com\n\n## License\ngo-middlewares is available under the MIT license. See the LICENSE file for more info.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-code%2Fgo-middlewares","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspace-code%2Fgo-middlewares","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-code%2Fgo-middlewares/lists"}