Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRoundTripper ¶
func NewRoundTripper(input *NewClientInput) http.RoundTripper
Types ¶
type NewClientInput ¶
type NewClientInput struct {
// The maximum size, in bytes, of the cache. A cache will
// only be used if this value is non-zero.
CacheMaxSizeBytes int64
// 0 for never expiring
CacheMaxAgeSeconds int64
// The base transport settings to use.
// This is not used for embedded Tor clients.
RoundTripper http.RoundTripper
// The maximum number of retries for each request. If less
// than 0, it will be treated as unlimited (technically,
// max int32)
MaxRetries int
// The minimum amount of time to wait between retries
RetryWaitMin time.Duration
// The maximum amount of time to wait between retries
RetryWaitMax time.Duration
// The logger to use. If not provided, the default one
// will be used.
Logger hashicorphttp.LeveledLogger
// A custom backoff function, if desired
Backoff func(min, max time.Duration, attemptNum int, resp *http.Response) time.Duration
// A custom retry function, if desired
CheckRetry func(ctx context.Context, resp *http.Response, httpErr error) (bool, error)
}
Click to show internal directories.
Click to hide internal directories.