proxy

package
v0.0.0-...-2d91a95 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConnectionTimeout is a interval for waiting to connect
	ConnectionTimeout = 4 //4s
	// DialTimeout is a interval for waiting to dial
	DialTimeout = 4 //4s
	// TryTimes is a time try again
	TryTimes = 3
	// MaxThreadNum is the maximum concurrency of IP speed
	MaxThreadNum = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

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

Proxy is a struct to used for managing proxy

func New

func New() *Proxy

New is a function for create proxy

func (*Proxy) Count

func (proxy *Proxy) Count() int64

Count is a funtion for get count of proxy IP

func (*Proxy) GetOne

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

GetOne is a fucntion for get unused proxy IP and response the time for loop

func (*Proxy) Update

func (proxy *Proxy) Update() *Proxy

Update is a funtion for update proxy IP list

func (*Proxy) UpdateTicker

func (proxy *Proxy) UpdateTicker(tickMinute int64)

UpdateTicker is a function for update timer

type UsableProxy

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

UsableProxy is a struct for handle proxy

func (*UsableProxy) Len

func (usable *UsableProxy) Len() int

Len is a function for implement the sorting interface

func (*UsableProxy) Less

func (usable *UsableProxy) Less(i, j int) bool

func (*UsableProxy) Swap

func (usable *UsableProxy) Swap(i, j int)

Jump to

Keyboard shortcuts

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