client

package
v0.0.0-...-27d8a96 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLimitExceeded = errors.New("connection limit exceeded")

Functions

This section is empty.

Types

type Config

type Config struct {
	Address                string        `yaml:"address"`
	DNSOverride            string        `yaml:"dns_override"`
	RemoteTimeout          time.Duration `yaml:"remote_timeout"`
	ConnectTimeout         time.Duration `yaml:"connect_timeout"`
	KeepAliveTimeout       time.Duration `yaml:"keep_alive_timeout"`
	MaxConnectionMultiplex int           `yaml:"max_connection_multiplex"`
}

func NewConfigFromFile

func NewConfigFromFile(filename string) (*Config, error)

type Connector

type Connector struct {
	Config *Config
}

func (*Connector) Connect

func (c *Connector) Connect(logger *log.Entry) (*MultiplexedConnection, error)

type Dialer

type Dialer struct {
	Connector          *Connector
	PreconnectPoolSize int
	// contains filtered or unexported fields
}

func (*Dialer) Close

func (d *Dialer) Close()

func (*Dialer) Closed

func (d *Dialer) Closed() bool

func (*Dialer) DialContext

func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (*Dialer) EnablePreconnect

func (d *Dialer) EnablePreconnect()

func (*Dialer) Ping

func (d *Dialer) Ping() (time.Duration, error)

type MultiplexedConnection

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

func NewMultiplexedConnection

func NewMultiplexedConnection(conn net.Conn, config *MultiplexedConnectionConfig) (*MultiplexedConnection, error)

func (*MultiplexedConnection) Close

func (c *MultiplexedConnection) Close()

func (*MultiplexedConnection) DialContext

func (c *MultiplexedConnection) DialContext(ctx context.Context, network, address string) (net.Conn, error)

func (*MultiplexedConnection) IsDialable

func (c *MultiplexedConnection) IsDialable() bool

func (*MultiplexedConnection) Ping

type MultiplexedConnectionConfig

type MultiplexedConnectionConfig struct {
	MaxMultiplexedConnections int
	RemoteDialTimeout         time.Duration
	KeepAliveTimeout          time.Duration
	Logger                    *log.Entry
}

Directories

Path Synopsis
tun

Jump to

Keyboard shortcuts

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