Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct { Name string Timeout Duration RetryCount int MaxIdleConns int MaxIdleConnsPerHost int }
ClientConfig is http client conf.
type Duration ¶
Duration be used toml unmarshal string time, like 1s, 500ms.
func (*Duration) UnmarshalText ¶
UnmarshalText unmarshal text to duration.
type HttpClient ¶
type HttpClient interface { Get(ctx context.Context, url string, headers http.Header, res interface{}) (ret *Resp) Post(ctx context.Context, url string, body io.Reader, headers http.Header, res interface{}) (ret *Resp) }
func NewClientV3 ¶
func NewClientV3(options ...Option) HttpClient
type Option ¶
type Option interface {
Apply(*Client)
}
Option represents the client options
func WithMaxIdleConns ¶
WithMaxIdleConns sets controls the maximum number of idle (keep-alive)
func WithMaxIdleConnsPerHost ¶
WithMaxIdleConnsPerHost sets controls the maximum idle
func WithTimeout ¶
Click to show internal directories.
Click to hide internal directories.