Documentation
¶
Index ¶
- func ContainsCookie(cookies []*http.Cookie, name string) bool
- func StringifyCookies(cookies []*http.Cookie) string
- func UnstringifyCookies(s string) []*http.Cookie
- type InMemoryStorage
- func (s *InMemoryStorage) Close() error
- func (s *InMemoryStorage) Cookies(u *url.URL) string
- func (s *InMemoryStorage) Init() error
- func (s *InMemoryStorage) IsVisited(requestID uint64) (bool, error)
- func (s *InMemoryStorage) SetCookies(u *url.URL, cookies string)
- func (s *InMemoryStorage) Visited(requestID uint64) error
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsCookie ¶
ContainsCookie 检查是否有指定名称的Cookie
func StringifyCookies ¶
StringifyCookies 将Cookie转为字符串
func UnstringifyCookies ¶
UnstringifyCookies 将字符串转为Cookie
Types ¶
type InMemoryStorage ¶
type InMemoryStorage struct {
// contains filtered or unexported fields
}
InMemoryStorage 默认存储器,将Cookies和网址保存在内存中
func (*InMemoryStorage) Cookies ¶
func (s *InMemoryStorage) Cookies(u *url.URL) string
Cookies 获取指定URL的Cookies
func (*InMemoryStorage) IsVisited ¶
func (s *InMemoryStorage) IsVisited(requestID uint64) (bool, error)
IsVisited 检查指定请求ID是否已经访问
func (*InMemoryStorage) SetCookies ¶
func (s *InMemoryStorage) SetCookies(u *url.URL, cookies string)
SetCookies 设置指定URL的Cookie
func (*InMemoryStorage) Visited ¶
func (s *InMemoryStorage) Visited(requestID uint64) error
Visited 设置指定请求ID为已访问
type Storage ¶
type Storage interface { // Init 初始化存储器 Init() error // Visited 设置指定请求ID为已访问 Visited(requestID uint64) error // IsVisited 检查指定请求ID是否已经访问 IsVisited(requestID uint64) (bool, error) // Cookies 获取指定URL的Cookies Cookies(u *url.URL) string // SetCookies 设置指定URL的Cookie SetCookies(u *url.URL, cookies string) }
Storage 存储Collector内部数据的接口
Click to show internal directories.
Click to hide internal directories.