Timeout support added

This commit is contained in:
Musab Gültekin
2019-06-08 20:36:11 +03:00
parent 2e3bd18430
commit f2fba85266
2 changed files with 7 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package geziyor
import (
"github.com/fpfeng/httpcache"
"time"
)
// Options is custom options type for Geziyor
@ -13,6 +14,8 @@ type Options struct {
StartURLs []string
// ParseFunc is callback of StartURLs response.
ParseFunc func(response *Response)
// Timeout is global request timeout
Timeout time.Duration
// Set this to enable caching responses.
// Memory Cache: httpcache.NewMemoryCache()