net

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0, BSD-2-Clause-Views, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHTTPResponse

func BuildHTTPResponse(statusCode int, body string) *http.Response

BuildHTTPResponse is used in tests

func GetResponse

func GetResponse(testServer *httptest.Server, values url.Values) (int, []byte)

GetResponse is used in tests

func JSONGetResponse

func JSONGetResponse(testServer *httptest.Server, data map[string]interface{}) (int, []byte)

JSONGetResponse is used in tests

Types

type HTTPClientInterface

type HTTPClientInterface interface {
	PostForm(url string, data url.Values) (resp *http.Response, err error)
	Get(url string) (resp *http.Response, err error)
}

HTTPClientInterface helps mocking http.Client in tests

Jump to

Keyboard shortcuts

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