Documentation ¶
Overview ¶
Package routers contains a minimal set of routers to test with lots of other optional routers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NullHandler ¶
func NullHandler(w http.ResponseWriter, r *http.Request)
NullHandler is a dummy web handler which does nothing
func Setup ¶
func Setup(routes []routes.Route, handler http.HandlerFunc)
Setup sets up these routers by addng the routes given to the router and recording memory usage before and after doing so.
func TestHandler ¶
func TestHandler(w http.ResponseWriter, r *http.Request)
TestHandler is a dummy web handler which simply writes 200 ok and hello world
Types ¶
type Router ¶
type Router interface { Name() string Setup() error Add(string, string, http.HandlerFunc) Serve(w http.ResponseWriter, r *http.Request) ParseHandler(w http.ResponseWriter, r *http.Request) ParamRegexp() bool }
Router defines an abstract wrapper around routers which supports setup, adding routes, and handling requests
Click to show internal directories.
Click to hide internal directories.