{"id":34151002,"url":"https://github.com/mantyr/prefixtree","last_synced_at":"2026-03-11T07:01:27.385Z","repository":{"id":57586588,"uuid":"175478773","full_name":"mantyr/prefixtree","owner":"mantyr","description":"Golang Parameterized Prefix Tree","archived":false,"fork":false,"pushed_at":"2019-03-27T10:57:46.000Z","size":17,"stargazers_count":5,"open_issues_count":4,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-17T20:22:28.709Z","etag":null,"topics":["params","prefixtree","router","tree"],"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/mantyr.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-03-13T18:38:50.000Z","updated_at":"2025-05-04T13:45:39.000Z","dependencies_parsed_at":"2022-09-13T12:40:53.702Z","dependency_job_id":null,"html_url":"https://github.com/mantyr/prefixtree","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mantyr/prefixtree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantyr%2Fprefixtree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantyr%2Fprefixtree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantyr%2Fprefixtree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantyr%2Fprefixtree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mantyr","download_url":"https://codeload.github.com/mantyr/prefixtree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mantyr%2Fprefixtree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30373505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T06:09:32.197Z","status":"ssl_error","status_checked_at":"2026-03-11T06:09:17.086Z","response_time":84,"last_error":"SSL_read: 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":["params","prefixtree","router","tree"],"created_at":"2025-12-15T05:03:51.511Z","updated_at":"2026-03-11T07:01:27.367Z","avatar_url":"https://github.com/mantyr.png","language":"Go","readme":"# Golang Parameterized Prefix Tree\n\n[![Build Status](https://travis-ci.org/mantyr/prefixtree.svg?branch=master)](https://travis-ci.org/mantyr/prefixtree)\n[![GoDoc](https://godoc.org/github.com/mantyr/prefixtree?status.png)](http://godoc.org/github.com/mantyr/prefixtree)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mantyr/prefixtree?v=4)][goreport]\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md)\n\nThis stable version\n\n## Priorities for the selection of values\n\n1. Static Node\n\n2. Params Node\n\n3. CatchAll Node\n\n## Restrictions\n\n1. CatchAll can be only one and only at the insert end\n```GO\nroot.SetString(\"/path/*filepath*other\", \"value\")      // error\nroot.SetString(\"/path/*filepath/*other\", \"value\")     // error\nroot.SetString(\"/path/*filepath/123/*other\", \"value\") // error\nroot.SetString(\"/path/*filepath\", \"value\")            // OK\n```\n\n2. CatchAll has the lowest priority\n```GO\nroot.SetString(\"/path/123/123\", \"value1\")   // OK\nroot.SetString(\"/path/:id/123\", \"value2\")   // OK\nroot.SetString(\"/path/*filepath\", \"value3\") // OK\n\nroot.GetString(\"/path/123/123\") // value1\nroot.GetString(\"/path/234/123\") // value2\nroot.GetString(\"/path/123/234\") // value3\n```\n\n## Installation\n\n    $ go get -u github.com/mantyr/prefixtree\n\n\n## Example\n```GO\npackage main\n\nimport (\n\t\"github.com/mantyr/prefixtree\"\n)\nfunc main() {\n\troot := prefixtree.New()\n\troot.SetString(\"/path/:dir/123\", \"value1\")\n\troot.SetString(\"/path/:dir/*filepath\", \"value2\")\n\troot.SetString(\"/path/user_:user\", \"value3\")\n\troot.SetString(\"/id/:id\", \"value4\")\n\troot.SetString(\"/id:id\", \"value5\")\n\troot.SetString(\":id/:name/123\", \"value6\")\n\troot.SetString(\"/id:id\", \"value7\")                 // error: path already in use\n\troot.SetString(\"/id:id2\", \"value8\")\n\n\tvalue, err := root.GetString(\"/path/123/file.zip\") \n\t/*\n\t\tvalue.Path = \"/path/123/file.zip\"\n\t\tvalue.Value = \"value2\"\n\t\tvalue.Params[\"dir\"] = \"123\"\n\t\tvalue.Params[\"filepath\"] = \"file.zip\"\n\t*/\n\titems := View(root)\n\t/*\n\t\titems = []string{\n\t\t\t\"^[/][path/]:dir[/][123]=value1\"\n\t\t\t\"^[/][path/]:dir[/]*filepath=value2\"\n\t\t\t\"^[/][path/][user_]:user=value3\"\n\t\t\t\"^[/][id][/]:id=value4\"\n\t\t\t\"^[/][id]:id=value5\"\n\t\t\t\"^[/][id]:id2=value8\"\n\t\t\t\"^:id[/]:name[/123]=value6\"\n\t\t}\n\t*/\n}\n```\n\n## Author\n\n[Oleg Shevelev][mantyr]\n\n[mantyr]: https://github.com/mantyr\n\n[build_status]: https://travis-ci.org/mantyr/prefixtree\n[godoc]:        http://godoc.org/github.com/mantyr/prefixtree\n[goreport]:     https://goreportcard.com/report/github.com/mantyr/prefixtree\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmantyr%2Fprefixtree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmantyr%2Fprefixtree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmantyr%2Fprefixtree/lists"}