Documentation
¶
Index ¶
- type Config
- type SQLite3Storage
- func (s *SQLite3Storage) CacheURL(URL string) error
- func (s *SQLite3Storage) Clear() error
- func (s *SQLite3Storage) Close() error
- func (s *SQLite3Storage) DeleteURL(URL string) error
- func (s *SQLite3Storage) Init(validity time.Duration, jitter time.Duration) error
- func (s *SQLite3Storage) IsCached(URL string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Validity is the duration for which the cache is valid.
Validity time.Duration
// Jitter is the jitter to apply when considering a cached entry valid or not.
Jitter time.Duration
// contains filtered or unexported fields
}
Config holds the cache configuration.
type SQLite3Storage ¶
type SQLite3Storage struct {
// SQLite filename.
Filename string
// Duration till which a link is skipped.
Validity time.Duration
// Clear cache at start if true.
ClearCache bool
// Jitter is used to add jitter when checking cache validity. 0 by default.
Jitter time.Duration
// contains filtered or unexported fields
}
Sqlite3Storage implements a SQLite3 caching backend for Colly.
func (*SQLite3Storage) CacheURL ¶
func (s *SQLite3Storage) CacheURL(URL string) error
CacheURL inserts new URL into cache database.
func (*SQLite3Storage) Clear ¶
func (s *SQLite3Storage) Clear() error
Clear removes all entries from cache.
func (*SQLite3Storage) DeleteURL ¶
func (s *SQLite3Storage) DeleteURL(URL string) error
DeleteURL deletes a URL from cache database.
Click to show internal directories.
Click to hide internal directories.