Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPClientWithProxy ¶
HTTPClientWithProxy returns a new http.Client with the proxyURl it will desable keepalive
func RegisterValidateFunc ¶
func RegisterValidateFunc(name string, validate ValidateFunc)
Types ¶
type Queue ¶
type Queue interface { // Enqueue enqueues a new unverified proxy addr Enqueue(addr string) }
Queue ...
type ValidateFunc ¶
type Validator ¶
type Validator interface { // Validate enqueues a new unverified proxy addr, handle // it asynchronously Validate(add string) // Run starts the Validator Run() // Stop stops the Validator Stop() // generic validator for proxy // Get returns a validated proxy Get() *v2.Proxy // Add adds a validated proxy Add(*v2.Proxy) // Delete delete the proxy Delete(*v2.Proxy) // Count returns the counts of validated proxy Count() int }
Validator ...
type Validators ¶
type Validators struct {
// contains filtered or unexported fields
}
Validators ...
func NewValidators ¶
func NewValidators() *Validators
func (*Validators) Delete ¶
func (v *Validators) Delete(name string)
Delete deletes the value for a key.
func (*Validators) Enqueue ¶
func (v *Validators) Enqueue(addr string)
func (*Validators) Load ¶
func (v *Validators) Load(name string) (Validator, bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*Validators) LoadOrStore ¶
func (v *Validators) LoadOrStore(name string, vv Validator) (Validator, bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.
func (*Validators) Run ¶
func (v *Validators) Run()
func (*Validators) Stop ¶
func (v *Validators) Stop()
Click to show internal directories.
Click to hide internal directories.