restclient

package
v0.0.0-...-f7e20ac Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMockup

func AddMockup(mock Mock)

AddMockup adds a new mockup

func FlushMockups

func FlushMockups()

FlushMockups resets the mocks to empty

func Get

func Get(URL string, headers http.Header) (*http.Response, error)

Get submits a HTTP GET request with the given parameters

func Post

func Post(URL string, body interface{}, headers http.Header) (*http.Response, error)

Post submits a HTTP POST request with the given parameters

func StartMockups

func StartMockups()

StartMockups indicates mocks are to be used

func StopMockups

func StopMockups()

StopMockups stops mocks from being used

Types

type Mock

type Mock struct {
	URL        string
	HTTPMethod string
	Response   *http.Response
	Err        error
}

Mock is used to mock up responses given a request

Jump to

Keyboard shortcuts

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