Documentation ¶
Index ¶
- Variables
- type Driver
- type HdProxy
- type Pool
- func (p *Pool) Close()
- func (p *Pool) CreateNewProxies()
- func (p *Pool) GetDriver() Driver
- func (p Pool) GetFreePry() []*Proxy
- func (p *Pool) GetMaxOpen() int
- func (p Pool) GetOpenNum() int
- func (p *Pool) GetPry() (*Proxy, error)
- func (p *Pool) PryIdleCleaner()
- func (p *Pool) PutPry(pry *Proxy) bool
- func (p *Pool) SetMaxIdle(num int)
- func (p *Pool) SetMaxOpen(num int)
- func (p *Pool) SetWaitPryTimeoutForGet(duration time.Duration)
- type Proxies
- type Proxy
- func (pry *Proxy) AddTimeoutCount()
- func (pry *Proxy) CancelListenAutoExpire()
- func (pry *Proxy) Close()
- func (pry *Proxy) CreateListenAutoExpire()
- func (pry Proxy) GetCity() string
- func (pry *Proxy) GetExpire() time.Time
- func (pry *Proxy) GetExpiredCh() <-chan struct{}
- func (pry Proxy) GetIpAddr() string
- func (pry Proxy) GetIsp() string
- func (pry Proxy) GetPoolDriverName() string
- func (pry Proxy) GetPort() uint64
- func (pry *Proxy) GetProxyIpAddr() string
- func (pry *Proxy) GetProxyUrl() string
- func (pry *Proxy) GetTimeoutCount() uint8
- func (pry *Proxy) GetTotalUseNum() uint
- func (pry *Proxy) GetUseNum() uint
- func (pry *Proxy) IsClosed() bool
- func (pry *Proxy) IsExpired() bool
- func (pry *Proxy) IsExpiredAndClose() bool
- func (pry Proxy) IsListenExpired() bool
- func (pry *Proxy) IsUse() bool
- func (pry *Proxy) Release() bool
- func (pry *Proxy) SetDelayReleaseNum(num int)
- func (pry *Proxy) SetExpiredAdvance(t time.Duration)
- func (pry *Proxy) SetExpiredAdvanceAsNotUse(t time.Duration)
- func (pry *Proxy) SetUse()
- type ZmProxy
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultExpireAdvance time.Duration = 0
View Source
var DefaultExpireAdvanceAsNotUse time.Duration = 0
View Source
var ErrMaxOpenCreatedPry = errors.New("已达到最大创建代理,无法创建新的代理")
View Source
var ErrPoolClosed = errors.New("代理池已关闭")
View Source
var ErrPryClosed = errors.New("对应代理已关闭")
View Source
var ErrPryExpired = errors.New("该代理已过期")
View Source
var ErrPutCreatedPry = errors.New("写入代理池失败")
View Source
var ErrWaitCreatedPry = errors.New("等待创建新的代理")
View Source
var ErrWaitPryTimeout = errors.New("等待获取代理超时")
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct { IsAutoCloseExpiredPry bool MaxPryUseNum uint // contains filtered or unexported fields }
func (*Pool) CreateNewProxies ¶
func (p *Pool) CreateNewProxies()
func (Pool) GetFreePry ¶
func (*Pool) GetMaxOpen ¶
func (Pool) GetOpenNum ¶
func (*Pool) SetMaxIdle ¶
func (*Pool) SetMaxOpen ¶
func (*Pool) SetWaitPryTimeoutForGet ¶
type Proxy ¶
func NewErrProxy ¶
func (*Proxy) AddTimeoutCount ¶
func (pry *Proxy) AddTimeoutCount()
func (*Proxy) CancelListenAutoExpire ¶
func (pry *Proxy) CancelListenAutoExpire()
func (*Proxy) CreateListenAutoExpire ¶
func (pry *Proxy) CreateListenAutoExpire()
func (*Proxy) GetExpiredCh ¶
func (pry *Proxy) GetExpiredCh() <-chan struct{}
func (Proxy) GetPoolDriverName ¶
func (*Proxy) GetProxyIpAddr ¶
func (*Proxy) GetProxyUrl ¶
func (*Proxy) GetTimeoutCount ¶
func (*Proxy) GetTotalUseNum ¶
func (*Proxy) IsExpiredAndClose ¶
func (Proxy) IsListenExpired ¶
func (*Proxy) SetDelayReleaseNum ¶
func (*Proxy) SetExpiredAdvance ¶
func (*Proxy) SetExpiredAdvanceAsNotUse ¶
Click to show internal directories.
Click to hide internal directories.