httpclient

package
v2.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2019 License: MIT Imports: 3 Imported by: 5

README

HttpClient

Http client with resillience factor built in. Utilizing Heimdall as it library. Default retrier is Constant Retrier. Please see Heimdall usage for more details.

NewHttpClient(*configuration) for creating new http client. If configuration is nil, default value will be used.

Example:

conf := new(HttpClientConf)
conf.BackoffInterval = 2 * time.Millisecond       // 2ms
conf.MaximumJitterInterval = 5 * time.Millisecond // 5ms
conf.Timeout = 15000 * time.Millisecond           // 15s
conf.RetryCount = 3  // 3 times

httpClient := NewHtgtpClient(conf)
resp, err := httpClient.Get("http://some-url", headers)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpClient

func NewHttpClient(conf *HttpClientConf) *httpclient.Client

Types

type HttpClientConf

type HttpClientConf struct {
	BackoffInterval       time.Duration
	MaximumJitterInterval time.Duration
	Timeout               time.Duration
	RetryCount            int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL