Documentation ¶
Index ¶
- func New(opts ...ClientOpt) nw_client.Rest
- func NewAssert(assert AssertResponse, client nw_client.Rest) nw_client.Rest
- type AssertClient
- type AssertResponse
- type ClientOpt
- func Assert(ar AssertResponse) ClientOpt
- func Client(client *http.Client) ClientOpt
- func Mock() ClientOpt
- func RateLimitSimulator(rate int, headerType nw_simulator.RetryAfterHeaderType, ...) ClientOpt
- func ReplayMock(rm []nw_replay.Response) ClientOpt
- func ServerErrorSimulator(rate int, code int, decorator nw_simulator.ResponseDecorator) ClientOpt
- type ClientOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssertClient ¶
type AssertClient struct {
// contains filtered or unexported fields
}
func (AssertClient) Call ¶
func (z AssertClient) Call(ctx api_context.Context, req nw_client.RequestBuilder) (res es_response.Response)
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 RateLimitSimulator ¶
func RateLimitSimulator(rate int, headerType nw_simulator.RetryAfterHeaderType, decorator nw_simulator.ResponseDecorator) ClientOpt
func ReplayMock ¶
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
Click to show internal directories.
Click to hide internal directories.