Request delays support added

This commit is contained in:
Musab Gültekin
2019-06-09 14:24:53 +03:00
parent 2263108838
commit b973c1c064
4 changed files with 32 additions and 2 deletions

View File

@ -10,10 +10,13 @@ type Options struct {
// AllowedDomains is domains that are allowed to make requests
// If empty, any domain is allowed
AllowedDomains []string
// First requests will made to this url array. (Concurrently)
StartURLs []string
// ParseFunc is callback of StartURLs response.
ParseFunc func(response *Response)
// Timeout is global request timeout
Timeout time.Duration
@ -24,10 +27,14 @@ type Options struct {
// Concurrent requests limit
ConcurrentRequests int
// Concurrent requests per domain limit
ConcurrentRequestsPerDomain int
// User Agent
UserAgent string
// Request delays
RequestDelay time.Duration
// RequestDelayRandomize uses random interval between 0.5 * RequestDelay and 1.5 * RequestDelay
RequestDelayRandomize bool
}