{"id":45938778,"url":"https://github.com/takashabe/go-router","last_synced_at":"2026-02-28T10:16:34.706Z","repository":{"id":57493312,"uuid":"77772270","full_name":"takashabe/go-router","owner":"takashabe","description":"HTTP request router","archived":false,"fork":false,"pushed_at":"2018-01-30T15:59:37.000Z","size":52,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-18T04:57:34.524Z","etag":null,"topics":["golang","http-router","router"],"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/takashabe.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}},"created_at":"2017-01-01T08:57:23.000Z","updated_at":"2024-04-18T04:57:34.524Z","dependencies_parsed_at":"2022-08-28T17:02:45.807Z","dependency_job_id":null,"html_url":"https://github.com/takashabe/go-router","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/takashabe/go-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takashabe%2Fgo-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takashabe%2Fgo-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takashabe%2Fgo-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takashabe%2Fgo-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takashabe","download_url":"https://codeload.github.com/takashabe/go-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takashabe%2Fgo-router/sbom","scorecard":{"id":866263,"data":{"date":"2025-08-18","repo":{"name":"github.com/takashabe/go-router","commit":"1eefa4c80f5545ca8e35c9dc96067ec42e6d1f2b"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3,"checks":[{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T02:45:10.724Z","repository_id":57493312,"created_at":"2025-08-24T02:45:10.724Z","updated_at":"2025-08-24T02:45:10.724Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29930175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["golang","http-router","router"],"created_at":"2026-02-28T10:16:33.686Z","updated_at":"2026-02-28T10:16:34.687Z","avatar_url":"https://github.com/takashabe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-router\n\n[![GoDoc](https://godoc.org/github.com/takashabe/go-router?status.svg)](https://godoc.org/github.com/takashabe/go-router)\n[![CircleCI](https://circleci.com/gh/takashabe/go-router.svg?style=shield\u0026circle-token=f285e086eb9de5226c56b89e2ee35cac0498baa4)](https://circleci.com/gh/takashabe/go-router)\n[![Go Report Card](https://goreportcard.com/badge/github.com/takashabe/go-router)](https://goreportcard.com/report/github.com/takashabe/go-router)\n\nProvide routing for HTTP request. It implemented `http.handler` interface, thereby easily introducing.\nSupport URL path parameters and can be mapped to argument of handler method.\n\n## Installation\n\n```\ngo get -u github.com/takashabe/go-router\n```\n\n## Usage\n\nBasic usage:\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"log\"\n  \"net/http\"\n\n  \"github.com/takashabe/go-router\"\n)\n\nfunc main() {\n  r := router.NewRouter()\n  r.Get(\"/\", func(w http.ResponseWriter, req *http.Request) {\n    fmt.Println(\"called get '/'\")\n  })\n  // Path \"/\" can be registered each HTTP methods\n  r.Post(\"/\", func(w http.ResponseWriter, req *http.Request) {\n    fmt.Println(\"called post '/'\")\n  })\n  // ex. receive query \"/10\":\n  // Mapped to id=10, and \"10\" already checked valid int type\n  r.Get(\"/:id\", func(w http.ResponseWriter, req *http.Request, id int) {\n    fmt.Printf(\"called get '/:id' with %d\\n\", id)\n  })\n\n  log.Fatal(http.ListenAndServe(\":8080\", r))\n}\n```\n\nFor static files:\n\n```go\nfunc Routes() *router.Router {\n  r := router.NewRouter()\n  r.Get(\"/\", getIndex)\n\n  // Query \"css/*\" mapped to \"./static/css/*\"\n  r.ServeDir(\"/css/*filepath\", http.Dir(\"static/css\"))\n\n  return r\n}\n```\n\nFor SPA application:\n\n```go\nfunc Routes() *router.Router {\n  r := router.NewRouter()\n\n  // Routing of the backend API\n  r.Get(\"/api/login\", ...)\n  r.Post(\"/api/login\", ...)\n\n  // Routing of the frontend\n  r.ServeFile(\"/\", \"./public/index.html\")\n  r.ServeFile(\"/bundle.js\", \"./public/bundle.js\")\n  r.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n    http.ServeFile(w, req, \"./public/index.html\")\n  })\n\n  return r\n}\n```\n\nFor customizable validation parameters:\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"log\"\n  \"net/http\"\n  \"regexp\"\n  \"strconv\"\n\n  \"github.com/takashabe/go-router\"\n)\n\n// Allow3DigitNumber expect allow 3 digit number\n// Require implements router.ValidateParam\ntype Allow3DigitNumber struct {\n  raw string\n}\n\n// Validate is validate URL path parameters\nfunc (v *Allow3DigitNumber) Validate(raw string) bool {\n  v.raw = raw\n  return regexp.MustCompile(`\\A[0-9]{3}\\z`).MatchString(raw)\n}\n\nfunc (v *Allow3DigitNumber) convert() (int, error) {\n  return strconv.Atoi(v.raw)\n}\n\nfunc main() {\n  r := router.NewRouter()\n  r.Get(\"/:id\", func(w http.ResponseWriter, req *http.Request, v *Allow3DigitNumber) {\n    id, _ := v.convert()\n    fmt.Printf(\"called get '/:id' with %d\\n\", id)\n  })\n\n  log.Fatal(http.ListenAndServe(\":8080\", r))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakashabe%2Fgo-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakashabe%2Fgo-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakashabe%2Fgo-router/lists"}