Skip to content

cosiner/router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Router

Router is a url router library for Go.

Documentation

Documentation can be found at Godoc.

Syntax

  • Static: /user

  • Param: /user/:id will catch user id, /user/:/following catch nothing but do only matching.

  • CatchAny: /folder/*path will 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.

LICENSE

MIT.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages