https://github.com/vedadiyan/gtr
Go Tiny Router
https://github.com/vedadiyan/gtr
Last synced: 3 months ago
JSON representation
Go Tiny Router
- Host: GitHub
- URL: https://github.com/vedadiyan/gtr
- Owner: Vedadiyan
- License: mit
- Created: 2022-12-14T06:07:12.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-12-14T07:02:21.000Z (over 2 years ago)
- Last Synced: 2025-01-10T08:45:04.650Z (5 months ago)
- Language: Go
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GTR

[](https://goreportcard.com/report/github.com/vedadiyan/gtr)GTR (being short for Go Tiny Router) is a minimalistic router
that was initially developed to identify RESTful call signatures
for the purpose of caching them (based on parameters).[Usage Examples]
GTR parses URLs based on Express style templates, for example:`http://www.abcdefg.com/api/v1/users/:username/details`
The provided URL can be successfully matched against the following
URLs:`http://www.abcdefg.com/api/v1/users/ken/details`
`http://www.abcdefg.com/api/v1/users/dennis/details`Alongside with route parameter, GTR also supports query string
specification, in such a way that if a query parameter is specified
a match will be successful only and only if the target URL also
specifies that query parameter and that it is of the same value as
originally specified. For example:`http://www.abcdefg.com/api/v1/users/:username/details?type=cached`
The provided URL can be successfully matched against the following
URLs:`http://www.abcdefg.com/api/v1/users/ken/details?type=cached&format=JSON`
`http://www.abcdefg.com/api/v1/users/dennis/details?type=cached`However, the following URLs will NOT be successfully matched:
`http://www.abcdefg.com/api/v1/users/ken/details?format=JSON`
`http://www.abcdefg.com/api/v1/users/dennis/details?`This behavior has been designed intentional to serve the original purpose
of the library.