adapter

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	constant.ProxyAdapter
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(adapter constant.ProxyAdapter) *Proxy

func (*Proxy) Alive

func (p *Proxy) Alive() bool

Alive implements constant.Proxy

func (*Proxy) DelayHistory

func (p *Proxy) DelayHistory() []constant.DelayHistory

DelayHistory implements constantProxy

func (*Proxy) Dial

func (p *Proxy) Dial(metadata *constant.Metadata) (constant.Conn, error)

Dial implements constant.Proxy

func (*Proxy) DialContext

func (p *Proxy) DialContext(ctx context.Context, metadata *constant.Metadata, opts ...dialer.Option) (constant.Conn, error)

DialContext implements constant.ProxyAdapter

func (*Proxy) DialUDP

func (p *Proxy) DialUDP(metadata *constant.Metadata) (constant.PacketConn, error)

DialUDP implements constant.ProxyAdapter

func (*Proxy) LastDelay

func (p *Proxy) LastDelay() (delay uint16)

LastDelay return last history record. if proxy is not alive, return the max value of uint16. implements constant.Proxy

func (*Proxy) ListenPacketContext

func (p *Proxy) ListenPacketContext(ctx context.Context, metadata *constant.Metadata, opts ...dialer.Option) (constant.PacketConn, error)

ListenPacketContext implements constant.ProxyAdapter

func (*Proxy) MarshalJSON

func (p *Proxy) MarshalJSON() ([]byte, error)

MarshalJSON implements constant.ProxyAdapter

func (*Proxy) URLTest

func (p *Proxy) URLTest(ctx context.Context, url string) (t uint16, err error)

URLTest get the delay for the specified URL implements constant.Proxy

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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