Documentation ¶
Index ¶
- Variables
- type FileProxyFactory
- type IDownloader
- type IProxy
- type IProxyFactory
- type Proxy
- type SimpleDownloader
- func (rd *SimpleDownloader) Download(request ent.IRequest) (ent.IPage, error)
- func (rd *SimpleDownloader) OnError(request ent.IRequest, err error)
- func (rd *SimpleDownloader) OnSuccess(request ent.IRequest)
- func (rd *SimpleDownloader) SetDownloadTimeout(dt time.Duration)
- func (rd *SimpleDownloader) Validate(ent.IPage) (bool, string)
Constants ¶
This section is empty.
Variables ¶
View Source
var LOG = utils.NewLogger()
Functions ¶
This section is empty.
Types ¶
type FileProxyFactory ¶
type FileProxyFactory struct {
// contains filtered or unexported fields
}
read proxy file and produce Proxy line format: {address} {Port}
func NewFileProxyFactory ¶
func NewFileProxyFactory(fileUrl string) (*FileProxyFactory, error)
func (*FileProxyFactory) GetProxy ¶
func (this *FileProxyFactory) GetProxy() (IProxy, error)
func (*FileProxyFactory) ReturnProxy ¶
func (this *FileProxyFactory) ReturnProxy(proxy IProxy)
type IDownloader ¶
type IProxyFactory ¶
type Proxy ¶
type Proxy struct { Id int `json:"id"` Host string `json:"host"` Port int `json:"port"` Username string `json:"username"` Password string `json:"password"` }
func (Proxy) GetPassword ¶
func (Proxy) GetUsername ¶
type SimpleDownloader ¶
type SimpleDownloader struct {
// contains filtered or unexported fields
}
func NewSimpleDownloader ¶
func NewSimpleDownloader(downloadTimeout time.Duration, provider IProxyFactory) *SimpleDownloader
func (*SimpleDownloader) OnError ¶
func (rd *SimpleDownloader) OnError(request ent.IRequest, err error)
func (*SimpleDownloader) OnSuccess ¶
func (rd *SimpleDownloader) OnSuccess(request ent.IRequest)
func (*SimpleDownloader) SetDownloadTimeout ¶
func (rd *SimpleDownloader) SetDownloadTimeout(dt time.Duration)
Click to show internal directories.
Click to hide internal directories.