fakehttpclient

package
v0.0.0-...-17b3830 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2015 License: Apache-2.0, BSD-3-Clause, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeHttpClient

type FakeHttpClient struct {
	Requests []*Request
}

func NewFakeHttpClient

func NewFakeHttpClient() *FakeHttpClient

func (*FakeHttpClient) Do

func (client *FakeHttpClient) Do(req *http.Request, callback func(*http.Response, error))

func (*FakeHttpClient) LastRequest

func (client *FakeHttpClient) LastRequest() *Request

func (*FakeHttpClient) Reset

func (client *FakeHttpClient) Reset()

type Request

type Request struct {
	*http.Request
	Callback func(*http.Response, error)
}

func (*Request) Respond

func (request *Request) Respond(statusCode int, body []byte, err error)

func (*Request) RespondWithError

func (request *Request) RespondWithError(err error)

func (*Request) RespondWithStatus

func (request *Request) RespondWithStatus(statusCode int)

func (*Request) Succeed

func (request *Request) Succeed(body []byte)

Jump to

Keyboard shortcuts

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