{"id":15525275,"url":"https://github.com/donatj/jqmux","last_synced_at":"2026-05-05T05:36:56.916Z","repository":{"id":54437217,"uuid":"191455681","full_name":"donatj/jqmux","owner":"donatj","description":"Go HTTP Multiplexer routing on JSON http request bodies via jq queries","archived":false,"fork":false,"pushed_at":"2021-10-07T15:35:47.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-03T06:38:43.175Z","etag":null,"topics":["go","http","jq","json","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/donatj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-11T21:53:55.000Z","updated_at":"2021-10-07T15:35:50.000Z","dependencies_parsed_at":"2022-08-13T15:40:27.942Z","dependency_job_id":null,"html_url":"https://github.com/donatj/jqmux","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2Fjqmux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2Fjqmux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2Fjqmux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/donatj%2Fjqmux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/donatj","download_url":"https://codeload.github.com/donatj/jqmux/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246100494,"owners_count":20723469,"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":["go","http","jq","json","mux","router"],"created_at":"2024-10-02T10:56:14.892Z","updated_at":"2026-05-05T05:36:56.911Z","avatar_url":"https://github.com/donatj.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jqmux\n\n[![CI](https://github.com/donatj/jqmux/actions/workflows/ci.yml/badge.svg)](https://github.com/donatj/jqmux/actions/workflows/ci.yml)\n[![GoDoc](https://godoc.org/github.com/donatj/jqmux?status.svg)](https://godoc.org/github.com/donatj/jqmux)\n[![Go Report Card](https://goreportcard.com/badge/github.com/donatj/jqmux)](https://goreportcard.com/report/github.com/donatj/jqmux)\n\nAn HTTP multiplexer which routes based on the incoming requests JSON body using the [jq syntax](https://stedolan.github.io/jq/manual/) of JSON value filtering.\n\nA particularly fruitful usecase for this is webhook routing.\n\n## Limitations\n\nThis utilizes the library [github.com/savaki/jq](https://github.com/savaki/jq) for it's jq parsing. While it is very fast it is not fully featured, so more complicated jq queries might not work. More information about it's workings and expected values can be found there.\n\n## Example\n\nThe first handler is executed if the body matches `{\"action\": \"opened\"}` whereas the second is executed if the body matches `{\"action\": \"synchronize\"}`\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/donatj/jqmux\"\n)\n\nfunc main() {\n\tmux := jqmux.NewMux()\n\n\tmux.HandleFunc(`.action`, `\"opened\"`, func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte(`body \"action\" was \"opened\"`))\n\t})\n\n\tmux.HandleFunc(`.action`, `\"synchronize\"`, func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Write([]byte(`body \"action\" was \"synchronize\"`))\n\t})\n\n\thttp.ListenAndServe(\":80\", mux)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonatj%2Fjqmux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdonatj%2Fjqmux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdonatj%2Fjqmux/lists"}