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

rtq

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 9 Imported by: 0

README

go-rtq

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchFunc added in v0.0.4

type MatchFunc func(*http.Request) (bool, error)

type MockTransport added in v0.0.4

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

Have a RoundTrip queue for each specific request, and if the request matches, retrieve the RoundTrip from the queue and execute it.

func NewTransport

func NewTransport(origin string, queues ...*RoundTripQueue) *MockTransport

func (*MockTransport) Completed added in v0.0.4

func (m *MockTransport) Completed() bool

func (*MockTransport) RequestLogString added in v0.0.5

func (m *MockTransport) RequestLogString() string

func (*MockTransport) RoundTrip added in v0.0.4

func (m *MockTransport) RoundTrip(req *http.Request) (*http.Response, error)

func (*MockTransport) SetMock added in v0.0.4

func (m *MockTransport) SetMock(origin string, queues ...*RoundTripQueue)

type RoundTripQueue

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

roundTrip queue

func New

func New() *RoundTripQueue

func (*RoundTripQueue) BodyString

func (q *RoundTripQueue) BodyString(body string) *RoundTripQueue

func (*RoundTripQueue) Delete

func (q *RoundTripQueue) Delete(path string) *RoundTripQueue

func (*RoundTripQueue) Get

func (q *RoundTripQueue) Get(path string) *RoundTripQueue

func (*RoundTripQueue) Header

func (q *RoundTripQueue) Header(key, value string) *RoundTripQueue

func (*RoundTripQueue) Matcher added in v0.0.4

func (q *RoundTripQueue) Matcher(matchFunc MatchFunc) *RoundTripQueue

func (*RoundTripQueue) Post

func (q *RoundTripQueue) Post(path string) *RoundTripQueue

func (*RoundTripQueue) Put

func (q *RoundTripQueue) Put(path string) *RoundTripQueue

func (*RoundTripQueue) Query

func (q *RoundTripQueue) Query(key, value string) *RoundTripQueue

func (*RoundTripQueue) Response

func (q *RoundTripQueue) Response(res *http.Response) *RoundTripQueue

func (*RoundTripQueue) ResponseFunc

func (q *RoundTripQueue) ResponseFunc(roundTrip func(*http.Request) (*http.Response, error)) *RoundTripQueue

func (*RoundTripQueue) ResponseJSON

func (q *RoundTripQueue) ResponseJSON(statusCode int, body any) *RoundTripQueue

func (*RoundTripQueue) ResponseSimple

func (q *RoundTripQueue) ResponseSimple(statusCode int, body string) *RoundTripQueue

Jump to

Keyboard shortcuts

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