🔗 HTTP router based on radix trees. 7 Commits
2023-07-09 21:24:24 +02:00
2023-07-09 17:46:17 +02:00
2023-07-09 17:46:17 +02:00
2023-07-09 21:24:24 +02:00
2023-07-10 11:41:37 +02:00
2023-07-10 11:41:37 +02:00
2023-07-09 12:42:33 +02:00
2023-07-09 17:46:17 +02:00
2023-07-10 12:02:34 +02:00
2023-07-10 11:59:21 +02:00
2023-07-09 21:24:24 +02:00
2023-07-09 17:46:17 +02:00
2023-07-09 12:42:33 +02:00

router

HTTP router based on radix trees.

Example

We can save any type of data inside the router. Here is an example storing strings for each route:

router := router.New[string]()

router.Add("GET", "/hello", "Hello")
router.Add("GET", "/world", "World")

Benchmarks

Requesting every single route in github.txt:

BenchmarkLookup-12                 33210             36134 ns/op           19488 B/op        337 allocs/op
BenchmarkLookupNoAlloc-12         103437             11331 ns/op               0 B/op          0 allocs/op