proxy

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONN_TIMEOUT = 4 //4s
	DAIL_TIMEOUT = 4 //4s
	TRY_TIMES    = 3
	// IP测速的最大并发量
	MAX_THREAD_NUM = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func New

func New() *Proxy

func (*Proxy) Count

func (self *Proxy) Count() int32

代理IP数量

func (*Proxy) GetOne

func (self *Proxy) GetOne(u string) (curProxy string)

获取本次循环中未使用的代理IP及其响应时长

func (*Proxy) Update

func (self *Proxy) Update() *Proxy

更新代理IP列表

func (*Proxy) UpdateTicker

func (self *Proxy) UpdateTicker(tickMinute int64)

更新继时器

type ProxyForHost

type ProxyForHost struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*ProxyForHost) Len

func (self *ProxyForHost) Len() int

实现排序接口

func (*ProxyForHost) Less

func (self *ProxyForHost) Less(i, j int) bool

func (*ProxyForHost) Swap

func (self *ProxyForHost) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL