Documentation ¶
Index ¶
- func IsCanonical(p string) (string, bool)
- func Re(expr string) func(h HandlerFunc) Route
- func ReCap(expr string) func(h interface{}) Route
- func Static(expr string) func(h HandlerFunc) Route
- func Wildcard() func(h HandlerFunc) Route
- type Context
- type HandlerFunc
- type Params
- type Route
- type Routes
- func (s *Routes) Add(r Route, methods ...string) error
- func (s *Routes) Connect(r Route) *Routes
- func (s *Routes) Delete(r Route) *Routes
- func (s *Routes) Get(r Route) *Routes
- func (s *Routes) Head(r Route) *Routes
- func (s *Routes) Options(r Route) *Routes
- func (s *Routes) Post(r Route) *Routes
- func (s *Routes) Put(r Route) *Routes
- func (s *Routes) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Routes) Trace(r Route) *Routes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCanonical ¶
func Re ¶
func Re(expr string) func(h HandlerFunc) Route
func Static ¶
func Static(expr string) func(h HandlerFunc) Route
func Wildcard ¶
func Wildcard() func(h HandlerFunc) Route
Types ¶
type Context ¶
type Context struct { *http.Request Response http.ResponseWriter Params Params }
func NewContext ¶
func NewContext(w http.ResponseWriter, r *http.Request) Context
func (*Context) RedirectPerm ¶
type HandlerFunc ¶
type HandlerFunc func(ctx Context)
func Wrap ¶
func Wrap(fn http.HandlerFunc) HandlerFunc
type Route ¶
type Route interface { Path() string IsCanonical(path string) (string, bool) Matches(path string) bool Execute(ctx Context) }
func NewRe ¶
func NewRe(expr string, h HandlerFunc) Route
func NewStatic ¶
func NewStatic(path string, h HandlerFunc) Route
func NewWildcard ¶
func NewWildcard(h HandlerFunc) Route
Click to show internal directories.
Click to hide internal directories.