{"id":37157059,"url":"https://github.com/obity/mux","last_synced_at":"2026-01-14T18:41:21.731Z","repository":{"id":47736131,"uuid":"394604715","full_name":"obity/mux","owner":"obity","description":"Mux is a simple and efficient route distributor that supports the net/http interface of the standard library. ","archived":false,"fork":false,"pushed_at":"2023-03-22T02:44:55.000Z","size":50,"stargazers_count":137,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-19T00:27:06.336Z","etag":null,"topics":["http-multiplexer","http-router","mux","router"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obity.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}},"created_at":"2021-08-10T10:00:42.000Z","updated_at":"2023-10-08T12:18:01.000Z","dependencies_parsed_at":"2022-08-30T08:11:44.924Z","dependency_job_id":"37b92546-8543-4e2b-a967-e20b7e2649ca","html_url":"https://github.com/obity/mux","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/obity/mux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obity%2Fmux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obity%2Fmux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obity%2Fmux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obity%2Fmux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obity","download_url":"https://codeload.github.com/obity/mux/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obity%2Fmux/sbom","scorecard":{"id":700958,"data":{"date":"2025-08-11","repo":{"name":"github.com/obity/mux","commit":"b6e6a79bd07225b0b8f99fe75c4b725a7f806304"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/23 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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/obity/mux/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/obity/mux/go.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","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 'main'"],"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: GNU General Public License v3.0: 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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 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"}},{"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"}}]},"last_synced_at":"2025-08-22T05:12:00.687Z","repository_id":47736131,"created_at":"2025-08-22T05:12:00.687Z","updated_at":"2025-08-22T05:12:00.687Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28430880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"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":["http-multiplexer","http-router","mux","router"],"created_at":"2026-01-14T18:41:20.938Z","updated_at":"2026-01-14T18:41:21.726Z","avatar_url":"https://github.com/obity.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mux\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/obity/mux?color=peru)](https://github.com/obity/mux/releases/latest)\n[![Released API docs](https://img.shields.io/badge/go-reference-blue?logo=go\u0026logoColor=white)](https://pkg.go.dev/github.com/obity/mux)\n[![Build](https://img.shields.io/github/actions/workflow/status/obity/mux/.github/workflows/go.yml?branch=master)](#)\n[![Go Report Card](https://goreportcard.com/badge/github.com/obity/mux?color=pink)](https://goreportcard.com/report/github.com/obity/mux)\n[![Lines of code](https://img.shields.io/tokei/lines/github/obity/mux.svg?color=beige)](#)\n[![Downloads of releases](https://img.shields.io/github/downloads/obity/mux/total.svg?color=lavender)](https://github.com/obity/mux/releases/latest)\n[![Languages](https://img.shields.io/github/languages/top/obity/mux.svg?color=yellow)](#)\n[![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/obity/mux)](#)\n[![GPL3 licensed](https://img.shields.io/github/license/obity/mux.svg)](./LICENSE)\n\nMux is a simple and efficient route distributor that supports the net/http interface of the standard library.\nRouting data is stored in the prefix tree preTree, supported by https://github.com/obity/pretree.\n\nThe current version only supports variable routes and simple routes such as /user/:id or /user/login.\nAccording to the http request method GET, HEAD, POST, PUT, PATCH, DELETE, CONNECT, OPTIONS, TRACE grouping is handled separately, and the routes between different groups are isolated from each other.\nRouting variable writing format supports both :id and {id},but the actual storage is :id.\n\n# Doc\n\nSee this document at [GoDoc](https://pkg.go.dev/github.com/obity/mux)\n\n# Install\n    \n    go get -u github.com/obity/mux@latest\n\n# ToDo\n\n- [x] 需要获取路由中的{var}变量，handler处理需要这些参数值传输到后端\n- [x] 抽象算法存储引擎,支持自定义算法，只要实现Engine接口就可以自己启用 \n- [x] 增加设置路由基础路径功能，统一设置API的版本如\"/v1\",\"/2\"默认不启用\n\n# Example\n```\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/obity/mux\"\n)\n\nfunc main() {\n\tm := mux.NewMux()\n\tm.GET(\"/pet/findByStatus\", Findbystatus)\n\tm.GET(\"/pet/{id}\", PetHandler)\n\tm.POST(\"/user/createWithList\", Createwithlist)\n\tm.DELETE(\"/user/:username\", Userinfo)\n\tm.Start(\":8001\")\n}\n\nfunc PetHandler(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tID := vars[\"id\"]\n\tw.WriteHeader(http.StatusOK)\n\tw.Write([]byte(\"ID:\" + ID))\n\treturn\n}\n\nfunc Findbystatus(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(http.StatusOK)\n\tw.Write([]byte(\"FindByStatus matched:\" + r.RequestURI))\n\treturn\n}\n\nfunc Createwithlist(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(http.StatusOK)\n\tw.Write([]byte(\"CreateWithList matched:\" + r.RequestURI))\n\treturn\n}\n\nfunc Userinfo(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(http.StatusOK)\n\tw.Write([]byte(\"UserInfo matched:\" + r.RequestURI))\n\treturn\n}\n\nfunc UserHandler(w http.ResponseWriter, r *http.Request) {\n\tw.WriteHeader(http.StatusOK)\n\tw.Write([]byte(\"UserInfo matched:\" + r.RequestURI))\n\treturn\n}\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobity%2Fmux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobity%2Fmux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobity%2Fmux/lists"}