testhelpers

package
v0.0.0-...-5c7c43f Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestMatcher

type RequestMatcher func(*http.Request)

type TestHandler

type TestHandler struct {
	Requests  []TestRequest
	CallCount int
}

func NewTLSServer

func NewTLSServer(requests []TestRequest) (s *httptest.Server, h *TestHandler)

func (*TestHandler) AllRequestsCalled

func (h *TestHandler) AllRequestsCalled() bool

func (*TestHandler) ServeHTTP

func (h *TestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TestRequest

type TestRequest struct {
	Method   string
	Path     string
	Header   http.Header
	Matcher  RequestMatcher
	Response TestResponse
}

func NewDirectorTestRequest

func NewDirectorTestRequest(request TestRequest) TestRequest

type TestResponse

type TestResponse struct {
	Body   string
	Status int
	Header http.Header
}

Jump to

Keyboard shortcuts

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