Documentation
¶
Index ¶
- func Do(req *Request, resp *Response) error
- func DoTimeout(req *Request, resp *Response, timeout time.Duration) error
- func Get(dst []byte, url string) (statusCode int, body []byte, err error)
- func GetBytesTimeoutURL(url string, timeout time.Duration) ([]byte, int, error)
- func GetBytesURL(url string) ([]byte, int, error)
- func GetStringTimeoutURL(url string, timeout time.Duration) (string, int, error)
- func GetStringURL(url string) (string, int, error)
- func GetTimeout(dst []byte, url string, timeout time.Duration) (statusCode int, body []byte, err error)
- func Post(dst []byte, url string, postArgs *fasthttp.Args) (statusCode int, body []byte, err error)
- func PostBytesTimeoutURL(url string, body []byte, timeout time.Duration) ([]byte, int, error)
- func PostBytesURL(url string, body []byte) ([]byte, int, error)
- func PostJSONTimeoutURL(url string, v any, timeout time.Duration) ([]byte, int, error)
- func PostJSONURL(url string, v any) ([]byte, int, error)
- func PostStringTimeoutURL(url string, body []byte, timeout time.Duration) (string, int, error)
- func PostStringURL(url string, body []byte) (string, int, error)
- type Client
- func (c *Client) Do(req *Request, resp *Response) error
- func (c *Client) DoBytes(method, url string, body []byte) ([]byte, int, error)
- func (c *Client) DoBytesTimeout(method, url string, body []byte, timeout time.Duration) ([]byte, int, error)
- func (c *Client) DoTimeout(req *Request, resp *Response, timeout time.Duration) error
- func (c *Client) GetBytes(url string) ([]byte, int, error)
- func (c *Client) GetBytesTimeout(url string, timeout time.Duration) ([]byte, int, error)
- func (c *Client) GetString(url string) (string, int, error)
- func (c *Client) GetStringTimeout(url string, timeout time.Duration) (string, int, error)
- func (c *Client) PostBytes(url string, body []byte) ([]byte, int, error)
- func (c *Client) PostBytesTimeout(url string, body []byte, timeout time.Duration) ([]byte, int, error)
- func (c *Client) PostJSON(url string, v any) ([]byte, int, error)
- func (c *Client) PostJSONTimeout(url string, v any, timeout time.Duration) ([]byte, int, error)
- func (c *Client) PostString(url string, body []byte) (string, int, error)
- func (c *Client) PostStringTimeout(url string, body []byte, timeout time.Duration) (string, int, error)
- func (c *Client) SetProxy(proxy string)
- func (c *Client) SetProxyFromEnvironment()
- func (c *Client) SetProxyFromEnvironmentTimeout(timeout time.Duration)
- func (c *Client) SetProxyHTTP(proxy string)
- func (c *Client) SetSOCKS5Proxy(proxyAddr string)
- type ClientOptions
- type ClientPool
- type HTTPVersion
- type Request
- type RequestCtx
- type RequestHandler
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBytesTimeoutURL ¶
func GetStringTimeoutURL ¶
func GetTimeout ¶
func PostBytesTimeoutURL ¶
func PostJSONTimeoutURL ¶
func PostStringTimeoutURL ¶
Types ¶
type Client ¶
func NewClientWithOptions ¶
func NewClientWithOptions(opt ClientOptions) *Client
func NewHighPerfClient ¶
func (*Client) DoBytesTimeout ¶
func (*Client) GetBytesTimeout ¶
func (*Client) GetStringTimeout ¶
func (*Client) PostBytesTimeout ¶
func (*Client) PostJSONTimeout ¶
func (*Client) PostString ¶
func (*Client) PostStringTimeout ¶
func (*Client) SetProxyFromEnvironment ¶
func (c *Client) SetProxyFromEnvironment()
func (*Client) SetProxyFromEnvironmentTimeout ¶
func (*Client) SetProxyHTTP ¶
func (*Client) SetSOCKS5Proxy ¶
type ClientOptions ¶
type ClientOptions struct {
HTTPVersion HTTPVersion
MaxConnsPerHost int
MaxIdleConnDuration time.Duration
MaxConnDuration time.Duration
MaxIdemponentCallAttempts int
ReadBufferSize int
WriteBufferSize int
ReadTimeout time.Duration
WriteTimeout time.Duration
MaxResponseBodySize int
NoDefaultUserAgentHeader bool
DisableHeaderNamesNormalizing bool
DisablePathNormalizing bool
MaxConnWaitTimeout time.Duration
TLSConfig *tls.Config
ProxyHTTP string
SOCKS5Proxy string
}
type ClientPool ¶
type ClientPool struct {
// contains filtered or unexported fields
}
func NewClientPool ¶
func NewClientPool(size int, factory func() *Client) *ClientPool
func NewHighPerfClientPool ¶
func NewHighPerfClientPool(size int, proxy string) *ClientPool
func NewProxyClientPool ¶
func NewProxyClientPool(proxies []string, perProxy int) *ClientPool
func NewProxyClientPoolFromString ¶
func NewProxyClientPoolFromString(list string, perProxy int) *ClientPool
func (*ClientPool) Next ¶
func (p *ClientPool) Next() *Client
type RequestCtx ¶
type RequestCtx = fasthttp.RequestCtx
type RequestHandler ¶
type RequestHandler = fasthttp.RequestHandler
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
all_features
command
|
|
|
bench
command
|
|
|
helpers
command
|
|
|
http1_basic
command
|
|
|
http1_proxy
command
|
|
|
http2_proxy
command
|
|
|
http3_basic
command
|
|
|
pool_proxies
command
|
Click to show internal directories.
Click to hide internal directories.