proxy

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, proxy Proxy)

Types

type Proxy

type Proxy interface {
	NewProxyImpl(dsn string) (ProxyContainer, error)
}

type ProxyConfig

type ProxyConfig struct {
	Id         int
	Ip         string
	Port       int
	Location   string
	Safe       bool
	Schema     string
	VerifyTime string
	Cnt        int
	Delayed    time.Duration
}

type ProxyConfigs

type ProxyConfigs []*ProxyConfig

func (ProxyConfigs) Len

func (a ProxyConfigs) Len() int

func (ProxyConfigs) Less

func (a ProxyConfigs) Less(i, j int) bool

func (ProxyConfigs) Swap

func (a ProxyConfigs) Swap(i, j int)

type ProxyContainer

type ProxyContainer interface {
	Init()
	One() *ProxyConfig
	Len() int
	Update(p *ProxyConfig)
	DeleteProxy(i int)
}

func NewProxy

func NewProxy(proxy_name, dsn string) (ProxyContainer, error)

type XiciConfig

type XiciConfig struct {
	MaxCawlCnt int    `json:"max_cawl_cnt"`
	Cnt        int    `json:"cnt"`
	MinCnt     int    `json:"min_cnt"`
	Root       string `json:"root"`
}

type XiciProxy

type XiciProxy struct {
}

func (*XiciProxy) NewProxyImpl

func (this *XiciProxy) NewProxyImpl(dsn string) (ProxyContainer, error)

type XiciProxyContainer

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

func (*XiciProxyContainer) DeleteProxy

func (this *XiciProxyContainer) DeleteProxy(i int)

func (*XiciProxyContainer) Init

func (this *XiciProxyContainer) Init()

func (*XiciProxyContainer) Len

func (this *XiciProxyContainer) Len() int

func (*XiciProxyContainer) One

func (this *XiciProxyContainer) One() *ProxyConfig

func (*XiciProxyContainer) TestProxy

func (this *XiciProxyContainer) TestProxy(p *ProxyConfig) bool

true means proxy is OK

func (*XiciProxyContainer) Update

func (this *XiciProxyContainer) Update(p *ProxyConfig)

Jump to

Keyboard shortcuts

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