Documentation ¶
Index ¶
- type Storage
- func (s *Storage) AddRequest(r []byte) error
- func (s *Storage) Clear() error
- func (s *Storage) Cookies(u *url.URL) string
- func (s *Storage) GetRequest() ([]byte, error)
- func (s *Storage) Init() error
- func (s *Storage) IsVisited(requestID uint64) (bool, error)
- func (s *Storage) QueueSize() (int, error)
- func (s *Storage) SetCookies(u *url.URL, cookies string)
- func (s *Storage) Visited(requestID uint64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct { // Address is the redis server address Address string // Password is the password for the redis server Password string // DB is the redis database. Default is 0 DB int // Prefix is an optional string in the keys. It can be used // to use one redis database for independent scraping tasks. Prefix string // Client is the redis connection Client *redis.Client // Expiration time for Visited keys. After expiration pages // are to be visited again. Expires time.Duration // contains filtered or unexported fields }
Storage implements the redis storage backend for Colly
func (*Storage) AddRequest ¶
AddRequest implements queue.Storage.AddRequest() function
func (*Storage) GetRequest ¶
GetRequest implements queue.Storage.GetRequest() function
func (*Storage) SetCookies ¶
SetCookies implements colly/storage..SetCookies()
Click to show internal directories.
Click to hide internal directories.