Options refactored to its own file. Timeout increased to 60 sec

This commit is contained in:
Musab Gültekin
2019-06-08 20:27:45 +03:00
parent b90908066b
commit 2e3bd18430
3 changed files with 22 additions and 12 deletions

21
options.go Normal file
View File

@ -0,0 +1,21 @@
package geziyor
import (
"github.com/fpfeng/httpcache"
)
// Options is custom options type for Geziyor
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)
// Set this to enable caching responses.
// Memory Cache: httpcache.NewMemoryCache()
// Disk Cache: diskcache.New(".cache")
Cache httpcache.Cache
}