Help us shape the future of Go! Take the 2026 Go Developer Survey

mock

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c []Call) api.Caller

Types

type Call

type Call struct {
	Verb     string
	Endpoint string
	Data     any
	Error    error
	Response *http.Response
}

type Mock

type Mock struct {
	Calls []Call
	// contains filtered or unexported fields
}

func (*Mock) Do

func (m *Mock) Do(verb, endpoint string, body io.Reader, out interface{}) error

func (*Mock) Request

func (m *Mock) Request(verb, endpoint string, body io.Reader) (*http.Response, error)

type MockError

type MockError struct {
	// contains filtered or unexported fields
}

func (*MockError) Error

func (e *MockError) Error() string

Jump to

Keyboard shortcuts

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