ipproxy

package module
v0.0.0-...-ea8dc3f Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: LGPL-3.0 Imports: 9 Imported by: 0

README

ipproxy

ip proxy pool in golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReserveOpt

func ReserveOpt(count int) func(*Option)

Types

type Config

type Config struct {
	//if the real speed is bigger than Config.Speed the ip will be dropped
	Speed         time.Duration
	Sources       []func() []api.IP
	HttpCheckUrl  string
	HttpsCheckUrl string
	FilterWorker  int32
	//the interval duration of checking forbidden ip
	CheckInterval time.Duration
}

type Option

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

type Pool

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

func NewPool

func NewPool(conf *Config) (p *Pool)

func (*Pool) CheckIP

func (p *Pool) CheckIP(ip *api.IP)

CheckIP is to check the ip work or not

func (*Pool) Close

func (p *Pool) Close()

func (*Pool) Get

func (p *Pool) Get(opts ...func(o *Option)) (ip *api.IP)

func (*Pool) Put

func (p *Pool) Put(ip *api.IP)

func (*Pool) Refresh

func (p *Pool) Refresh()

func (*Pool) Stats

func (p *Pool) Stats() Stat

type Stat

type Stat struct {
	All       int32
	Rented    int32
	Available int32
	Forbidden int32
	Bad       int32
	Filter    int32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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