package
1.24.0
Repository: https://github.com/elastic/cloud-sdk-go.git
Documentation: pkg.go.dev

# Functions

AssertRequest ensures that a RequestAssertion matches certain *http.Request fields.
New200Response creates a new response with a statuscode 200.
New200ResponseAssertion creates a new response with request assertion and a statuscode 200.
New200StructResponse takes in a structure and creates a 200 Response.
New201Response creates a new response with a statuscode 201.
New201ResponseAssertion creates a new response with request assertion and a statuscode 201.
New202Response creates a new response with a statuscode 202.
New202ResponseAssertion creates a new response with request assertion and a statuscode 202.
New302Response creates a new response with a statuscode 302.
New302ResponseAssertion creates a new response with request assertion and a statuscode 302.
New400Response creates a new response with a statuscode 400.
New400ResponseAssertion creates a new response with request assertion and a statuscode 400.
New404Response creates a new response with a statuscode 404.
New404ResponseAssertion creates a new response with request assertion and a statuscode 404.
New409Response creates a new response with a statuscode 409.
New409ResponseAssertion creates a new response with request assertion and a statuscode 409.
New500Response creates a new response with a statuscode 500.
New500ResponseAssertion creates a new response with request assertion and a statuscode 500.
New501Response creates a new response with a statuscode 501.
New501ResponseAssertion creates a new response with request assertion and a statuscode 501.
New502Response creates a new response with a statuscode 502.
New502ResponseAssertion creates a new response with request assertion and a statuscode 502.
NewByteBody creates an io.ReadCloser from a slice of bytes.
NewClient returns a pointer to http.Client with the mocked Transport.
NewErrorBody creates a replica of a body representing an EC API error.
NewErrorResponse creates a replica of a responnse representing an EC API error.
NewMatchingByEndpointClient returns a pointer to http.Client with the mocked Transport.
NewRoundTripper initializes a new roundtripper and accepts multiple Response structures as variadric arguments.
NewRoundTripper initializes a new roundtripper and accepts multiple Response structures as variadric arguments.
NewStringBody creates an io.ReadCloser from a string.
NewStructBody creates an io.ReadCloser from a structure that is attempted to be encoded into JSON.
NewStructResponse takes in a structure and creates a Response with the specified StatusCode.
SampleBadRequestError returns a response which encapsulates a 400 error.
SampleInternalError returns a response which encapsulates a 500 error.
SampleNotFoundError returns a response which encapsulates a 404 error.

# Variables

MultierrorBadRequest represents the multierror returned by apier.Unwrap().
MultierrorInternalError represents the multierror returned by apier.Unwrap().
MultierrorNotFound represents the multierror returned by apier.Unwrap().
ValidClusterID holds a valid cluster id value.

# Structs

APIError can be used to create a multiple error response.
MatchingByEndpointRoundTripper is aimed to be used as the Transport property in an http.Client in order to mock the responses that it would return in the normal execution, matching by endpoint.
RequestAssertion is used to assert the contents of the request passed to an http.RoundTripper.
Response Wraps the response of the RoundTrip.
RoundTripper is aimed to be used as the Transport property in an http.Client in order to mock the responses that it would return in the normal execution.