routers

package
v0.0.0-...-e8bd762 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 8 Imported by: 0

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 Load

func Load()

Load adds the muxes we want to consider to our list

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

func All

func All() []Router

All returns the list of routers to test

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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