Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(timeout time.Duration, customCACert []byte, requestManipulator aurestclientapi.RequestManipulatorCallback) (aurestclientapi.Client, error)
New builds a new http client.
Do not share between different logging/circuit breaker/retry stacks, but you should only build each stack once.
timeout MUST be set to 0 if you use a circuit breaker or anything else that may do a context cancel, or you'll get weird behavior.
If len(customCACert) is 0, the default CA certificates are used, but if you specify it, they are excluded to ensure only your certs are accepted.
Types ¶
type HttpClientImpl ¶
type HttpClientImpl struct {
HttpClient *http.Client
RequestManipulator aurestclientapi.RequestManipulatorCallback
Timeout time.Duration
// Now is exposed so tests can fixate the time by overwriting this field
Now func() time.Time
}
func (*HttpClientImpl) Perform ¶
func (c *HttpClientImpl) Perform(ctx context.Context, method string, requestUrl string, requestBody interface{}, response *aurestclientapi.ParsedResponse) error
Click to show internal directories.
Click to hide internal directories.