Documentation ¶
Overview ¶
Package resty HTTP and REST client library with parallel feature
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultDialTimeout default timeout of a dialer DefaultDialTimeout = 5 * time.Second // DefaultRequestTimeout default time out of a http request DefaultRequestTimeout = 10 * time.Second // DefaultRetry retry times if a request is failed with 5xx status code DefaultRetry = 3 )
View Source
var CreateClient = func(t *http.Transport, timeout time.Duration) Client { client := &http.Client{ Transport: t, } if timeout > 0 { client.Timeout = timeout } return client }
CreateClient a function that create a client instance
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Resty)
Option set restry option
func WithHeader ¶
WithHeader set header for http request
func WithRetry ¶
WithRetry set retry times if request is failure with 5xx status code. retry is ingore if it is less than 1.
func WithTimeout ¶
WithTimeout set timeout of http request.
Click to show internal directories.
Click to hide internal directories.