fakes

package
v0.0.0-...-4ee4f08 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 3 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 {
	http.Client
	SpyRequest   *http.Request
	FakeResponse *http.Response
	FakeError    error
}

FakeHTTPClient - a fake http client

func (*FakeHTTPClient) Do

func (s *FakeHTTPClient) Do(fakeRequest *http.Request) (*http.Response, error)

Do - Fake HTTP client do method

type FakeInfo

type FakeInfo struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Arch    string `json:"arch"`
}

FakeInfo - Fake info struct

type FakeRenderer

type FakeRenderer struct {
	render.Render
	SpyStatusCode     int
	SpyValue          interface{}
	SpyResponseWriter http.ResponseWriter
}

FakeRenderer - a fake unrolled Renderer

func (*FakeRenderer) JSON

func (s *FakeRenderer) JSON(res http.ResponseWriter, statusCode int, value interface{}) (err error)

JSON - fake json renderer

func (*FakeRenderer) Text

func (s *FakeRenderer) Text(res http.ResponseWriter, statusCode int, value string) (err error)

Text - fake text Renderer

type FakeRequestBody

type FakeRequestBody struct {
	io.Reader
}

FakeRequestBody - a fake response body object

func (FakeRequestBody) Close

func (FakeRequestBody) Close() error

Close - close fake body

type FakeResponseBody

type FakeResponseBody struct {
	io.Reader
}

FakeResponseBody - a fake response body object

func (FakeResponseBody) Close

func (FakeResponseBody) Close() error

Close - close fake body

Jump to

Keyboard shortcuts

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