Documentation
¶
Index ¶
- type RoundTripQueue
- func (q *RoundTripQueue) BodyString(body string) *RoundTripQueue
- func (q *RoundTripQueue) Delete(path string) *RoundTripQueue
- func (q *RoundTripQueue) Get(path string) *RoundTripQueue
- func (q *RoundTripQueue) Header(key, value string) *RoundTripQueue
- func (q *RoundTripQueue) Post(path string) *RoundTripQueue
- func (q *RoundTripQueue) Put(path string) *RoundTripQueue
- func (q *RoundTripQueue) Query(key, value string) *RoundTripQueue
- func (q *RoundTripQueue) Response(res *http.Response) *RoundTripQueue
- func (q *RoundTripQueue) ResponseFunc(roundTrip func(*http.Request) (*http.Response, error)) *RoundTripQueue
- func (q *RoundTripQueue) ResponseJSON(statusCode int, body any) *RoundTripQueue
- func (q *RoundTripQueue) ResponseSimple(statusCode int, body string) *RoundTripQueue
- type RoundTripQueues
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) SetMock ¶
func (qs *RoundTripQueues) SetMock(origin string, queueList ...*RoundTripQueue)
Click to show internal directories.
Click to hide internal directories.