Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentType ¶
type ContentType int
const ( JSON ContentType = iota XML FORM MULTIPART )
func (ContentType) String ¶
func (c ContentType) String() string
type Downloader ¶
type Downloader interface {
Download(request model.Request, site *model.Site) (*model.Page, error)
}
Downloader 下载器接口
type HttpClientDownloader ¶
type HttpClientDownloader struct { HttpClientGenerator *HttpClientGenerator HttpClients sync.Map ProxyProvider proxy.ProxyProvider }
func CreateDownloader ¶
func CreateDownloader() *HttpClientDownloader
func (*HttpClientDownloader) Download ¶
func (downloader *HttpClientDownloader) Download(request model.Request, site *model.Site) (*model.Page, error)
Download 下载 实现接口方法
func (HttpClientDownloader) GetClient ¶
func (downloader HttpClientDownloader) GetClient(site model.Site) *http.Client
func (*HttpClientDownloader) SetProxyProvider ¶
func (downloader *HttpClientDownloader) SetProxyProvider(proxyProvider proxy.ProxyProvider)
type HttpClientGenerator ¶
func (*HttpClientGenerator) CreateClient ¶
func (generator *HttpClientGenerator) CreateClient(site model.Site) *http.Client
func (*HttpClientGenerator) CreateProxyClient ¶
Click to show internal directories.
Click to hide internal directories.