{"id":46249943,"url":"https://github.com/mythrnr/httprouter-group","last_synced_at":"2026-03-03T22:01:39.626Z","repository":{"id":57573325,"uuid":"351467665","full_name":"mythrnr/httprouter-group","owner":"mythrnr","description":"For defining grouped routing with `julienschmidt/httprouter`.","archived":false,"fork":false,"pushed_at":"2026-01-11T16:35:01.000Z","size":110,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-11T19:44:11.846Z","etag":null,"topics":["go","httprouter","router"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/mythrnr/httprouter-group","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/mythrnr.png","metadata":{"files":{"readme":"README.jp.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-03-25T14:33:43.000Z","updated_at":"2026-01-11T16:34:06.000Z","dependencies_parsed_at":"2024-06-20T17:28:51.018Z","dependency_job_id":"738b022c-1dfd-46ef-b7ae-80836d8fa01e","html_url":"https://github.com/mythrnr/httprouter-group","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":"mythrnr/template-lib-golang","purl":"pkg:github/mythrnr/httprouter-group","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mythrnr%2Fhttprouter-group","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mythrnr%2Fhttprouter-group/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mythrnr%2Fhttprouter-group/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mythrnr%2Fhttprouter-group/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mythrnr","download_url":"https://codeload.github.com/mythrnr/httprouter-group/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mythrnr%2Fhttprouter-group/sbom","scorecard":{"id":392679,"data":{"date":"2025-08-11","repo":{"name":"github.com/mythrnr/httprouter-group","commit":"f0f706667c622964d0bb1529405f37cc977f5e83"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":6,"reason":"dependency not pinned by hash detected -- score normalized to 6","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/check-code.yaml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/mythrnr/httprouter-group/check-code.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/scan-vulnerabilities.yaml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/mythrnr/httprouter-group/scan-vulnerabilities.yaml/master?enable=pin","Info:   8 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/check-code.yaml:12","Info: topLevel 'contents' permission set to 'read': .github/workflows/scan-vulnerabilities.yaml:9","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T18:12:17.095Z","repository_id":57573325,"created_at":"2025-08-18T18:12:17.095Z","updated_at":"2025-08-18T18:12:17.095Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30063357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","httprouter","router"],"created_at":"2026-03-03T22:01:38.943Z","updated_at":"2026-03-03T22:01:39.617Z","avatar_url":"https://github.com/mythrnr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# httprouter-group\n\n[English](./README.md)\n\n## Status\n\n[![Check codes](https://github.com/mythrnr/httprouter-group/actions/workflows/check-code.yaml/badge.svg)](https://github.com/mythrnr/httprouter-group/actions/workflows/check-code.yaml)\n\n[![Scan Vulnerabilities](https://github.com/mythrnr/httprouter-group/actions/workflows/scan-vulnerabilities.yaml/badge.svg)](https://github.com/mythrnr/httprouter-group/actions/workflows/scan-vulnerabilities.yaml)\n\n## Description\n\n[`mythrnr/httprouter-group`](https://github.com/mythrnr/httprouter-group) は\n[`julienschmidt/httprouter`](https://github.com/julienschmidt/httprouter) にルーティングをグループ化して定義する機能を追加する.\n\n詳細は [GoDoc](https://pkg.go.dev/github.com/mythrnr/httprouter-group) を参照\n\n## Feature\n\n### [`RouteGroup`](https://github.com/mythrnr/httprouter-group/blob/master/route_group.go)\n\n- `(*RouteGroup).Children(...*RouteGroup)` で登録した `RouteGroup`\n  は親のパスとミドルウェアを引き継ぐことができる.\n- `mythrnr/httprouter-group` は定義を簡素化するためのもので, 次の例の通り\n  `julienschmidt/httprouter` のパフォーマンスには影響を与えない.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n    \"net/http\"\n\n    \"github.com/julienschmidt/httprouter\"\n    group \"github.com/mythrnr/httprouter-group\"\n)\n\n// This definition provides following routes.\n//\n// - `GET /` with middleware 1\n// - `GET /users` with middleware 1, 2\n// - `GET /users/:id` with middleware 1, 2\n// - `PUT /users/:id` with middleware 1, 3\n// - `DELETE /users/:id` with middleware 1, 3\n//\nfunc main() {\n    // first, define routes, handlers, and middlewares.\n    g := group.New(\"/\").GET(\n        func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n            w.Write([]byte(\"GET /\\n\"))\n        },\n    ).Middleware(\n        func(h httprouter.Handle) httprouter.Handle {\n            return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n                w.Write([]byte(\"Middleware 1: before\\n\"))\n                h(w, r, p)\n                w.Write([]byte(\"Middleware 1: after\\n\"))\n            }\n        },\n    ).Children(\n        group.New(\"/users\").GET(\n            func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n                w.Write([]byte(\"GET /users\\n\"))\n            },\n        ).Middleware(\n            func(h httprouter.Handle) httprouter.Handle {\n                return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n                    w.Write([]byte(\"Middleware 2: before\\n\"))\n                    h(w, r, p)\n                    w.Write([]byte(\"Middleware 2: after\\n\"))\n                }\n            },\n        ).Children(\n            group.New(\"/:id\").GET(\n                func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n                    w.Write([]byte(\"GET /users/:id\\n\"))\n                },\n            ),\n        ),\n        group.New(\"/users/:id\").PUT(\n            func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n                w.Write([]byte(\"PUT /users/:id\\n\"))\n            },\n        ).DELETE(\n            func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n                w.Write([]byte(\"DELETE /users/:id\\n\"))\n            },\n        ).Middleware(\n            func(h httprouter.Handle) httprouter.Handle {\n                return func(w http.ResponseWriter, r *http.Request, p httprouter.Params) {\n                    w.Write([]byte(\"Middleware 3: before\\n\"))\n                    h(w, r, p)\n                    w.Write([]byte(\"Middleware 3: after\\n\"))\n                }\n            },\n        ),\n    )\n\n    // next, set up and configure router.\n    router := httprouter.New()\n    router.PanicHandler = func(w http.ResponseWriter, r *http.Request, rec any) {\n        log.Fatal(rec)\n    }\n\n    // logging.\n    //\n    // GET     /\n    // GET     /users\n    // DELETE  /users/:id\n    // GET     /users/:id\n    // PUT     /users/:id\n    fmt.Println(g.Routes().String())\n\n    // finally, register routes to httprouter instance.\n    for _, r := range g.Routes() {\n        router.Handle(r.Method(), r.Path(), r.Handler())\n    }\n\n    // serve.\n    log.Fatal(http.ListenAndServe(\":8080\", router))\n}\n```\n\n## Requirements\n\n- Go 1.24 以上.\n- Docker (開発時)\n\n## Install\n\nGet it with `go get`.\n\n```bash\ngo get github.com/mythrnr/httprouter-group\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmythrnr%2Fhttprouter-group","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmythrnr%2Fhttprouter-group","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmythrnr%2Fhttprouter-group/lists"}