httpmock: github.com/goware/httpmock Index | Files

package httpmock

import "github.com/goware/httpmock"

Index

Package Files

defaults_go15.go httpmock.go mock_builder.go

type MockHTTPServer Uses

type MockHTTPServer struct {
    Listener    net.Listener
    ResponseMap map[string]Response
}

func NewMockHTTPServer Uses

func NewMockHTTPServer(b ...string) *MockHTTPServer

func (*MockHTTPServer) AddResponse Uses

func (m *MockHTTPServer) AddResponse(resp MockResponse) error

func (*MockHTTPServer) AddResponses Uses

func (m *MockHTTPServer) AddResponses(resp []MockResponse) error

func (*MockHTTPServer) ServeHTTP Uses

func (m *MockHTTPServer) ServeHTTP(w http.ResponseWriter, req *http.Request)

type MockResponse Uses

type MockResponse struct {
    Request  http.Request
    Response Response
}

type Response Uses

type Response struct {
    StatusCode int
    Header     http.Header
    Body       string
}

Package httpmock imports 6 packages (graph). Updated 2017-12-14. Refresh now. Tools for package owners.