Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PathHandler ¶
PathHandler will fail if the request doesn't match based on reqPath. If it matches it returns the given response status and body.
reqPath should be of the form `<METHOD> <PATH>`. For example: `GET /foo`.
Types ¶
type ServeReplay ¶
type ServeReplay struct { Handlers []http.Handler NoneLeftFunc func(*testing.T, *http.Request) // contains filtered or unexported fields }
ServeReplay is an http.Handler It contains a list of handlers and calls the next handler in the list for each incoming request.
If a request is received and no more handlers are available, ServeReplay calls NoneLeftFunc. The default behavior of NoneLeftFunc is to call t.Errorf with some information about the request.
func NewServeReplay ¶
func NewServeReplay(t *testing.T) *ServeReplay
NewServeReplay returns a new ServeReplay.
func (*ServeReplay) Add ¶
func (h *ServeReplay) Add(handler http.Handler) *ServeReplay
Add appends a handler to ServReplay's handler list. It returns itself to allow chaining.
func (*ServeReplay) ServeHTTP ¶
func (h *ServeReplay) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP dispatches the request to the next handler in the list.