Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PageDownloader ¶
type PageDownloader interface {
Id() uint32 // 获得ID。
Download(req base.Request) (*base.Response, error) // 根据请求下载网页并返回响应。
}
网页下载器的接口类型。
type PageDownloaderPool ¶
type PageDownloaderPool interface {
Take() (PageDownloader, error) // 从池中取出一个网页下载器。
Return(dl PageDownloader) error // 把一个网页下载器归还给池。
Total() uint32 // 获得池的总容量。
Used() uint32 // 获得正在被使用的网页下载器的数量。
}
网页下载器池的接口类型。
func NewPageDownloaderPool ¶
func NewPageDownloaderPool( total uint32, gen GenPageDownloader) (PageDownloaderPool, error)
创建网页下载器池。
Click to show internal directories.
Click to hide internal directories.