net

package
v0.0.0-...-db1d7af Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveWhiteSpaceFromBody

func RemoveWhiteSpaceFromBody(body string) string

Types

type JSONArrayRequest

type JSONArrayRequest []interface{}

func (*JSONArrayRequest) String

func (json *JSONArrayRequest) String() string

type JSONMapRequest

type JSONMapRequest map[string]interface{}

func (*JSONMapRequest) String

func (json *JSONMapRequest) String() string

type RequestMatcher

type RequestMatcher func(mr.TestingT, *http.Request)

func RequestBodyMatcher

func RequestBodyMatcher(expectedBodyString string) RequestMatcher

func RequestBodyMatcherWithContentType

func RequestBodyMatcherWithContentType(expectedBody, expectedContentType string) RequestMatcher

type TestHandler

type TestHandler struct {
	Requests  []TestRequest
	CallCount int
	T         mr.TestingT
}

func NewServer

func NewServer(t mr.TestingT, requests []TestRequest) (s *httptest.Server, h *TestHandler)

func NewTLSServer

func NewTLSServer(t mr.TestingT, 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
}

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