router

package
v0.0.0-...-beacedc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2014 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(mux *http.ServeMux, r ...*Router)

Types

type GorillaRouterToMuxer

type GorillaRouterToMuxer struct {
	*mux.Router
}

func (*GorillaRouterToMuxer) Handle

func (ø *GorillaRouterToMuxer) Handle(pattern string, handler http.Handler)

func (*GorillaRouterToMuxer) HandleFunc

func (ø *GorillaRouterToMuxer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

type Muxer

type Muxer interface {
	Handle(pattern string, handler http.Handler)
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
}

is fullfilled by *mux.Router and *http.ServeMux

type Route

type Route struct{ *mux.Route }

func (*Route) Name

func (ø *Route) Name(name string) *Route

func (*Route) URL

func (ø *Route) URL(vals ...string) string

type Router

type Router struct {
	*mux.Router
	// contains filtered or unexported fields
}

func New

func New(path string, middlewares ...rack.Wrapper) (ø *Router)

func (*Router) Mount

func (ø *Router) Mount(m *http.ServeMux)

func (*Router) NewRoute

func (ø *Router) NewRoute() *Route

overwrite the URL method with our own Route struct

func (*Router) ServeHTTP

func (ø *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Router) SubRouter

func (ø *Router) SubRouter(p string, middlewares ...rack.Wrapper) (rr *Router)

func (*Router) Wrap

func (ø *Router) Wrap(middlewares ...rack.Wrapper)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL