httpmock

package
v0.0.0-...-66efcd7 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpCall

type HttpCall struct {
	*mock.Call
}

func (*HttpCall) AddHeader

func (c *HttpCall) AddHeader(key, val string) *HttpCall

func (*HttpCall) Return

func (c *HttpCall) Return(statusCode int, out interface{}, outErr error) *HttpCall

func (*HttpCall) Run

func (c *HttpCall) Run(run func(req *http.Request)) *HttpCall

type MatchOn

type MatchOn struct {
	HttpMethod string
	Url        string
	Header     http.Header
	Body       interface{}
}

type Mock

type Mock struct {
	mock.Mock
}

func NewMock

func NewMock() *Mock

func (*Mock) Do

func (m *Mock) Do(req *http.Request) (*http.Response, error)

func (*Mock) GET

func (m *Mock) GET(url string) *HttpCall

func (*Mock) POST

func (m *Mock) POST(url string, body interface{}) *HttpCall

Jump to

Keyboard shortcuts

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