nw_rest

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...ClientOpt) nw_client.Rest

func NewAssert

func NewAssert(assert AssertResponse, client nw_client.Rest) nw_client.Rest

Types

type AssertClient

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

func (AssertClient) Call

type AssertResponse

type AssertResponse func(res es_response.Response) es_response.Response

Assert broken response or rate limit for retry

type ClientOpt

type ClientOpt func(o ClientOpts) ClientOpts

func Assert

func Assert(ar AssertResponse) ClientOpt

func Client

func Client(client *http.Client) ClientOpt

func Mock

func Mock() ClientOpt

func RateLimitSimulator

func RateLimitSimulator(rate int, headerType nw_simulator.RetryAfterHeaderType, decorator nw_simulator.ResponseDecorator) ClientOpt

func ReplayMock

func ReplayMock(rm []nw_replay.Response) ClientOpt

func ServerErrorSimulator

func ServerErrorSimulator(rate int, code int, decorator nw_simulator.ResponseDecorator) ClientOpt

type ClientOpts

type ClientOpts struct {
	Assert     AssertResponse
	Mock       bool
	ReplayMock []nw_replay.Response
	// contains filtered or unexported fields
}

func (ClientOpts) Apply

func (z ClientOpts) Apply(opts ...ClientOpt) ClientOpts

Jump to

Keyboard shortcuts

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