Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Default is an instance of net/http.Client that has // retry enabled and is used if Client.Client is nil. Default = New(&Options{ RetryTimeMax: 45 * time.Second, }) )
Functions ¶
Types ¶
type Options ¶
type Options struct { // Value for net.Dialer.Timeout. Timeout time.Duration `envconfig:"TIMEOUT"` // Value for net.Dialer.KeepAlive. KeepAlive time.Duration `envconfig:"KEEP_ALIVE"` // Value for net/http.Transport.TLSHandshakeTimeout. TLSHandshakeTimeout time.Duration `envconfig:"TLS_HANDSHAKE_TIMEOUT"` // Value for crypto/tls.Config.TLSSkipVerify. TLSSkipVerify bool `envconfig:"TLS_SKIP_VERIFY"` // Maximum time while Dialer reties are made. // Default is 0. Which means that Retrying is disabled by default. RetryTimeMax time.Duration `envconfig:"RETRY_TIME_MAX"` // Maximum time between two retries. // Default is 2 seconds. RetrySleepMax time.Duration `envconfig:"RETRY_SLEEP_MAX"` // Time for first retry. Every other is doubled until RetrySleepMax. // Default is 200 milliseconds. RetrySleepBase time.Duration `envconfig:"RETRY_SLEEP_BASE"` }
Options is structure that passes optional variables to New function.
func (Options) MarshalJSON ¶
MarshalJSON implements of json.Marshaler interface. It marshals string representations of time.Duration.
func (Options) MarshalYAML ¶
MarshalYAML implements of yaml.Marshaler interface. It marshals string representations of time.Duration.
func (*Options) UnmarshalJSON ¶
UnmarshalJSON implements json.Unamrshaler interface. It parses time.Duration as strings.
func (*Options) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unamrshaler interface. It parses time.Duration as strings.
Click to show internal directories.
Click to hide internal directories.