Router is a url router library for Go.
Documentation can be found at Godoc.
-
Static:
/user -
Param:
/user/:idwill catch user id,/user/:/followingcatch nothing but do only matching. -
CatchAny:
/folder/*pathwill catch any characters after/folder/, there should be nothing after it. -
Param and CatchAny can has a optional regexp flag, just like
/user/:id:[\da-f]+and/folder/*path:.*\.go. -
The matching order is: Static, Param(with regexp flag), Param, CatchAny(with regexp flag), CatchAny.
-
NOTE:
/match only/,/*match anything.
MIT.