dialchain

package
v5.6.9+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LayerDeltaCBDialer

func LayerDeltaCBDialer(
	cb DialLayerCallback,
	dialer transport.Dialer,
	layer func(transport.Dialer) (transport.Dialer, error),
) (transport.DialerFunc, error)

Types

type DialLayerCallback

type DialLayerCallback interface {
	Start()
	Done(err error)
}

type DialerChain

type DialerChain struct {
	Net    NetDialer
	Layers []Layer
}

func (*DialerChain) AddLayer

func (c *DialerChain) AddLayer(l Layer)

func (*DialerChain) Build

func (c *DialerChain) Build() (d transport.Dialer, err error)

func (*DialerChain) BuildWith

func (c *DialerChain) BuildWith(makeCB func(string) DialLayerCallback) (d transport.Dialer, err error)

func (*DialerChain) BuildWithMeasures

func (c *DialerChain) BuildWithMeasures(event common.MapStr) (transport.Dialer, error)

func (*DialerChain) Clone

func (c *DialerChain) Clone() *DialerChain

func (*DialerChain) Dial

func (c *DialerChain) Dial(network, host string) (conn net.Conn, err error)

func (*DialerChain) DialWithMeasurements

func (c *DialerChain) DialWithMeasurements(network, host string) (fields common.MapStr, conn net.Conn, err error)

func (*DialerChain) TestBuild

func (c *DialerChain) TestBuild() error

type Layer

type Layer struct {
	Name    string
	Builder func(transport.Dialer) (transport.Dialer, error)
}

func ConstAddrLayer

func ConstAddrLayer(addr string, l Layer) Layer

func SOCKS5Layer

func SOCKS5Layer(name string, config *transport.ProxyConfig) Layer

func TLSLayer

func TLSLayer(name string, config *transport.TLSConfig, timeout time.Duration) Layer

type MeasureCallback

type MeasureCallback func(start, end time.Time)

type MeasureLayerRTTCB

type MeasureLayerRTTCB struct {
	Callback MeasureCallback
	// contains filtered or unexported fields
}

func (*MeasureLayerRTTCB) Done

func (cb *MeasureLayerRTTCB) Done(_ error)

func (*MeasureLayerRTTCB) Start

func (cb *MeasureLayerRTTCB) Start()

type NetDialer

type NetDialer struct {
	Name   string
	Dialer transport.Dialer
}

func ConstAddrDialer

func ConstAddrDialer(name, addr string, to time.Duration) NetDialer

func TCPDialer

func TCPDialer(name string, to time.Duration) NetDialer

func UDPDialer

func UDPDialer(name string, to time.Duration) NetDialer

Jump to

Keyboard shortcuts

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