proxypool

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrURLInvalid = errors.New("URL Invalid")
	ErrNoValid    = errors.New("No Valid")
)

Functions

This section is empty.

Types

type AliveCheck

type AliveCheck func(*url.URL) bool

type Config

type Config struct {
	Logf       quick.Logf // 日志方法
	AliveCheck AliveCheck // 是检查代理存活的方法
	Verbose    bool       // true:打印详细的日志
	// contains filtered or unexported fields
}

type GetProxy

type GetProxy func() (*url.URL, error)

type ProxyPool

type ProxyPool struct {
	// contains filtered or unexported fields
}

func New

func New(conf Config) *ProxyPool

func (*ProxyPool) Add

func (p *ProxyPool) Add(rawurl string) error

Add 添加一个代理 rawurl: http://xxxx:yy

func (*ProxyPool) All

func (p *ProxyPool) All() []*url.URL

func (*ProxyPool) Get

func (p *ProxyPool) Get() (*url.URL, error)

func (*ProxyPool) Stop

func (p *ProxyPool) Stop()

Jump to

Keyboard shortcuts

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