Documentation
¶
Index ¶
- Constants
- func IsConnTimeoutErr(err error) bool
- func WithConsTimeoutEnabled(val bool) func(*HTTPClient) error
- func WithDefaultTimeout(val time.Duration) func(*HTTPClient) error
- func WithMaxDefaultTimeout(val time.Duration) func(*HTTPClient) error
- func WithSlidingWindowEnabled(val bool) func(*HTTPClient) error
- func WithSlidingWindowSize(val int) func(*HTTPClient) error
- func WithSlidingWindowThreshold(val int) func(*HTTPClient) error
- func WithTimeoutIncInterval(val time.Duration) func(*HTTPClient) error
- func WithTimeoutReportCount(val int) func(*HTTPClient) error
- type HTTPClient
- type HTTPStats
- type Option
- type Window
Constants ¶
View Source
const ( ClientDefaultTimeout = time.Duration(1) * time.Second // Sec ClientTimeoutIncInterval = time.Duration(2) * time.Second // Sec ClientTimeoutReportCount = 5 // Count ClientWindowDefaultThreshold = 70 // indicates % of timeout reports when window is full ClientWindowDefaultSize = 5 // Window Size )
View Source
const ( DNSLookup = "DNSLookup" TCPConnection = "TCPConnection" TLSHandshake = "TLSHandshake" ServerProcessing = "ServerProcessing" ContentTransfer = "ContentTransfer" Total = "Total" )
Variables ¶
This section is empty.
Functions ¶
func IsConnTimeoutErr ¶
func WithConsTimeoutEnabled ¶
func WithConsTimeoutEnabled(val bool) func(*HTTPClient) error
func WithDefaultTimeout ¶
func WithDefaultTimeout(val time.Duration) func(*HTTPClient) error
func WithMaxDefaultTimeout ¶
func WithMaxDefaultTimeout(val time.Duration) func(*HTTPClient) error
func WithSlidingWindowEnabled ¶
func WithSlidingWindowEnabled(val bool) func(*HTTPClient) error
func WithSlidingWindowSize ¶
func WithSlidingWindowSize(val int) func(*HTTPClient) error
func WithSlidingWindowThreshold ¶
func WithSlidingWindowThreshold(val int) func(*HTTPClient) error
func WithTimeoutIncInterval ¶
func WithTimeoutIncInterval(val time.Duration) func(*HTTPClient) error
func WithTimeoutReportCount ¶
func WithTimeoutReportCount(val int) func(*HTTPClient) error
Types ¶
type HTTPClient ¶
func NewHTTPClient ¶
func NewHTTPClient(h *http.Client, opts ...Option) (*HTTPClient, error)
func (*HTTPClient) NotifySlidingWindow ¶
func (h *HTTPClient) NotifySlidingWindow(stats *HTTPStats)
type HTTPStats ¶
type HTTPStats struct {
DNSLookup int `json:"DNSLookup"`
TCPConnection int `json:"TCPConnection"`
TLSHandshake int `json:"TLSHandshake"`
ServerProcessing int `json:"ServerProcessing"`
ContentTransfer int `json:"ContentTransfer"`
Total int `json:"Total"`
URL string `json:"URL"`
Timeout int `json:"ClientTimeout"`
Message string `json:"message"`
}
type Option ¶
type Option func(*HTTPClient) error
Click to show internal directories.
Click to hide internal directories.