thyrsus

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyHeaders map[string]string = make(map[string]string, 0)

Functions

This section is empty.

Types

type BaseMockResponse

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

func (BaseMockResponse) Body

func (res BaseMockResponse) Body() []byte

func (BaseMockResponse) Headers

func (res BaseMockResponse) Headers() map[string]string

func (BaseMockResponse) Status

func (res BaseMockResponse) Status() int

type ExpectHttp

type ExpectHttp struct {
	Errors []string
	// contains filtered or unexported fields
}

func NewExpectHttp

func NewExpectHttp() *ExpectHttp

func (*ExpectHttp) Close

func (exp *ExpectHttp) Close()

func (*ExpectHttp) ExpectRequest

func (exp *ExpectHttp) ExpectRequest(url string, response MockResponse)

func (*ExpectHttp) ExpectRequestWithHeaders added in v0.2.0

func (exp *ExpectHttp) ExpectRequestWithHeaders(url string, response MockResponse, requestHeaders map[string]string)

func (*ExpectHttp) Start

func (exp *ExpectHttp) Start() string

func (*ExpectHttp) ValidateExpectations

func (exp *ExpectHttp) ValidateExpectations(T *testing.T)

type MockRequest

type MockRequest struct {
	Url            string
	Response       MockResponse
	RequestHeaders map[string]string
}

type MockResponse

type MockResponse interface {
	Status() int
	Body() []byte
	Headers() map[string]string
}

func JSONMockResponse

func JSONMockResponse(status int, body interface{}, headers map[string]string) MockResponse

Jump to

Keyboard shortcuts

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