test

package
v0.0.0-...-695afe7 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GorillaMuxHandlerInfo

func GorillaMuxHandlerInfo(router *mux.Router) func(r *http.Request) *HandlerInfo

GorillaMuxHandlerInfo takes a mux.Router and finds handler info from it.

func RegisterHandlerInfoFunc

func RegisterHandlerInfoFunc(fn handlerInfoFunc)

func RegisterURLVarExtractor

func RegisterURLVarExtractor(fn parse.URLVarExtractor)

Types

type HandlerInfo

type HandlerInfo struct {
	FuncName string
}

func DefaultHandlerInfo

func DefaultHandlerInfo(r *http.Request) *HandlerInfo

type ResponseWriter

type ResponseWriter struct {
	HandlerInfo HandlerInfo
	URLVars     map[string]string
	W           *httptest.ResponseRecorder
	// contains filtered or unexported fields
}

func (*ResponseWriter) Header

func (rw *ResponseWriter) Header() http.Header

func (*ResponseWriter) Write

func (rw *ResponseWriter) Write(b []byte) (int, error)

func (*ResponseWriter) WriteHeader

func (rw *ResponseWriter) WriteHeader(c int)

type Server

type Server struct {
	*httptest.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(handler http.Handler) (s *Server, err error)

TODO: filter out 404 responses

func (*Server) Finish

func (s *Server) Finish()

Jump to

Keyboard shortcuts

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