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

rtq

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 8 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 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) 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

type RoundTripQueues

type RoundTripQueues 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() *RoundTripQueues

func (*RoundTripQueues) Completed

func (qs *RoundTripQueues) Completed() bool

func (*RoundTripQueues) RoundTrip

func (qs *RoundTripQueues) RoundTrip(req *http.Request) (*http.Response, error)

func (*RoundTripQueues) SetMock

func (qs *RoundTripQueues) SetMock(origin string, queueList ...*RoundTripQueue)

Jump to

Keyboard shortcuts

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