Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HTTPConfigURL is the url to connect to for this HTTP configuration HTTPConfigURL = "url" // HTTPConfigProxyURL adds a proxy HTTPConfigProxyURL = "proxy.url" // HTTPConfigHeaders adds custom headers to the requests HTTPConfigHeaders = "headers" // HTTPConfigAuthUsername HTTPS Basic Auth configuration - username HTTPConfigAuthUsername = "auth.username" // HTTPConfigAuthPassword HTTPS Basic Auth configuration - secret / password HTTPConfigAuthPassword = "auth.password" // HTTPConfigRetryEnabled whether retry is enabled on the actions performed over this HTTP request (does not disable retry at higher layers) HTTPConfigRetryEnabled = "retry.enabled" // HTTPConfigRetryCount the maximum number of retries HTTPConfigRetryCount = "retry.count" // HTTPConfigRetryInitDelay the initial retry delay HTTPConfigRetryInitDelay = "retry.initWaitTime" // HTTPConfigRetryMaxDelay the maximum retry delay HTTPConfigRetryMaxDelay = "retry.maxWaitTime" // HTTPConfigRequestTimeout the request timeout HTTPConfigRequestTimeout = "requestTimeout" // HTTPCustomClient - unit test only - allows injection of a custom HTTP client to resty HTTPCustomClient = "customClient" )
Variables ¶
This section is empty.
Functions ¶
func InitPrefix ¶
func New ¶
New creates a new Resty client, using static configuration (from the config file) from a given nested prefix in the static configuration
You can use the normal Resty builder pattern, to set per-instance configuration as required.
func OnAfterResponse ¶
func OnAfterResponse(c *resty.Client, resp *resty.Response)
OnAfterResponse when using SetDoNotParseResponse(true) for streming binary replies, the caller should invoke ffrest.OnAfterResponse on the response manually. The middleware is disabled on this path :-( See: https://github.com/go-resty/resty/blob/d01e8d1bac5ba1fed0d9e03c4c47ca21e94a7e8e/client.go#L912-L948
func WrapRestErr ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.