Documentation ¶
Index ¶
- Variables
- func CreateProxiedDialer(proxyURL string) (fasthttp.DialFunc, error)
- func GetResponseHeaders(resp *http.Response) map[string]string
- func NewThrottledTransport(limitPeriod time.Duration, requestCount int, transportWrap http.RoundTripper) http.RoundTripper
- func SetRequestBody(body interface{}, req *http.Request) error
- type Config
- type CustomClient
- type Http
- type ThrottledTransport
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = NewHttp(HttpDefaultConfig) // this won't be proxied
View Source
var HttpDefaultConfig = NewConfig(&HttpDefaultRateLimit, &HttpDefaultTlsVerification, &emptyStr)
View Source
var HttpDefaultRateLimit = 60
View Source
var HttpDefaultTlsVerification = true
Functions ¶
func CreateProxiedDialer ¶
CreateDialer returns a dialer function based on the given proxy URL and type. returns non proxied dialer if empty string is passed.
func NewThrottledTransport ¶
func NewThrottledTransport(limitPeriod time.Duration, requestCount int, transportWrap http.RoundTripper) http.RoundTripper
NewThrottledTransport wraps the provided transport with a rate limiter
func SetRequestBody ¶
Types ¶
type CustomClient ¶
type CustomClient struct { Requests []*client.Request Responses []*client.ConcurrentResponse Client *http.Client }
func NewConfigHttp2 ¶
func NewConfigHttp2(requestsPerSecond *int, skipTlsVerification *bool, proxy *string) *CustomClient
type Http ¶
type Http struct { Requests []*client.Request Responses []*client.ConcurrentResponse Config *Config Client *client.RateLimitedClient }
type ThrottledTransport ¶
type ThrottledTransport struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.