Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlushMocks ¶
func FlushMocks()
func StartMockServer ¶
func StartMockServer()
func StopMockServer ¶
func StopMockServer()
Types ¶
type Client ¶
type Client interface { Get(url string, headers ...http.Header) (*Response, error) Post(url string, body interface{}, headers ...http.Header) (*Response, error) Put(url string, body interface{}, headers ...http.Header) (*Response, error) Patch(url string, body interface{}, headers ...http.Header) (*Response, error) Delete(url string, headers ...http.Header) (*Response, error) Options(url string, headers ...http.Header) (*Response, error) }
type ClientBuilder ¶
type ClientBuilder interface { SetHeader(headers http.Header) ClientBuilder SetConnectionTimeout(timeout time.Duration) ClientBuilder SetMaxIdleConnections(conn int) ClientBuilder SetRequestTimeout(timeout time.Duration) ClientBuilder DisableTimeouts(b bool) ClientBuilder SetHttpClient(c *http.Client) ClientBuilder SetUserAgent(userAgent string) ClientBuilder Build() Client }
func NewBuilder ¶
func NewBuilder() ClientBuilder
type Mock ¶
type Mock struct { Method string Url string RequestBody string ResponseBody string ResponseStatusCode int Error error }
Mock struct configure HTTP mocks based on the combination between request method, request url and request body.
func (*Mock) GetResponse ¶
GetResponse returns an response object based on the mock configuration.
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func (*Response) StatusCode ¶
func (*Response) UnmarshalJson ¶
Click to show internal directories.
Click to hide internal directories.