beats: github.com/elastic/beats/libbeat/common/transport Index | Files | Directories

package transport

import "github.com/elastic/beats/libbeat/common/transport"

Index

Package Files

client.go pipelistener.go proxy.go stats.go tcp.go tls.go transport.go util.go wrap.go

Variables

var (
    ErrNotConnected = errors.New("client is not connected")
)

func Dial Uses

func Dial(c Config, network, address string) (net.Conn, error)

func DialWith Uses

func DialWith(
    dialer Dialer,
    network, host string,
    addresses []string,
    port string,
) (c net.Conn, err error)

DialWith randomly dials one of a number of addresses with a given dialer.

Use this to select and dial one IP being known for one host name.

type Client Uses

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

func NewClient Uses

func NewClient(c Config, network, host string, defaultPort int) (*Client, error)

func NewClientWithDialer Uses

func NewClientWithDialer(d Dialer, c Config, network, host string, defaultPort int) (*Client, error)

func (*Client) Close Uses

func (c *Client) Close() error

func (*Client) Connect Uses

func (c *Client) Connect() error

func (*Client) Host Uses

func (c *Client) Host() string

func (*Client) IsConnected Uses

func (c *Client) IsConnected() bool

func (*Client) LocalAddr Uses

func (c *Client) LocalAddr() net.Addr

func (*Client) Read Uses

func (c *Client) Read(b []byte) (int, error)

func (*Client) RemoteAddr Uses

func (c *Client) RemoteAddr() net.Addr

func (*Client) SetDeadline Uses

func (c *Client) SetDeadline(t time.Time) error

func (*Client) SetReadDeadline Uses

func (c *Client) SetReadDeadline(t time.Time) error

func (*Client) SetWriteDeadline Uses

func (c *Client) SetWriteDeadline(t time.Time) error

func (*Client) String Uses

func (c *Client) String() string

func (*Client) Test Uses

func (c *Client) Test(d testing.Driver)

func (*Client) Write Uses

func (c *Client) Write(b []byte) (int, error)

type Config Uses

type Config struct {
    Proxy   *ProxyConfig
    TLS     *tlscommon.TLSConfig
    Timeout time.Duration
    Stats   IOStatser
}

type Dialer Uses

type Dialer interface {
    Dial(network, address string) (net.Conn, error)
}

func ConnWrapper Uses

func ConnWrapper(d Dialer, w func(net.Conn) net.Conn) Dialer

func MakeDialer Uses

func MakeDialer(c Config) (Dialer, error)

func NetDialer Uses

func NetDialer(timeout time.Duration) Dialer

func ProxyDialer Uses

func ProxyDialer(log *logp.Logger, config *ProxyConfig, forward Dialer) (Dialer, error)

func StatsDialer Uses

func StatsDialer(d Dialer, s IOStatser) Dialer

func TLSDialer Uses

func TLSDialer(forward Dialer, config *tlscommon.TLSConfig, timeout time.Duration) (Dialer, error)

func TestNetDialer Uses

func TestNetDialer(d testing.Driver, timeout time.Duration) Dialer

func TestTLSDialer Uses

func TestTLSDialer(
    d testing.Driver,
    forward Dialer,
    config *tlscommon.TLSConfig,
    timeout time.Duration,
) (Dialer, error)

func TestUnixDialer Uses

func TestUnixDialer(d testing.Driver, timeout time.Duration, sockFile string) Dialer

TestUnixDialer creates a Test Unix Dialer when using domain socket.

func UnixDialer Uses

func UnixDialer(timeout time.Duration, sockFile string) Dialer

UnixDialer creates a Unix Dialer when using unix domain socket.

type DialerFunc Uses

type DialerFunc func(network, address string) (net.Conn, error)

func (DialerFunc) Dial Uses

func (d DialerFunc) Dial(network, address string) (net.Conn, error)

type IOStatser Uses

type IOStatser interface {
    WriteError(err error)
    WriteBytes(int)

    ReadError(err error)
    ReadBytes(int)
}

type PipeListener Uses

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

PipeListener is a net.PipeListener that uses net.Pipe It is only relevant for the APM Server instrumentation of itself

func NewPipeListener Uses

func NewPipeListener() *PipeListener

NewPipeListener returns a new PipeListener.

func (*PipeListener) Accept Uses

func (l *PipeListener) Accept() (net.Conn, error)

Accept waits for and returns the next connection to the listener. This is part of the net.listener address.

func (*PipeListener) Addr Uses

func (l *PipeListener) Addr() net.Addr

Addr returns the listener's network address. This is part of the net.listener interface.

The returned address's network and value are always both "pipe", the same as the addresses returned by net.Pipe connections.

func (*PipeListener) Close Uses

func (l *PipeListener) Close() error

Close closes the listener. This is part of the net.PipeListener interface.

func (*PipeListener) DialContext Uses

func (l *PipeListener) DialContext(ctx context.Context, network, addr string) (net.Conn, error)

DialContext dials a connection to the listener, blocking until a paired Accept call is made, the listener is closed, or the context is canceled/expired.

type ProxyConfig Uses

type ProxyConfig struct {
    // URL of the SOCKS proxy. Scheme must be socks5. Username and password can be
    // embedded in the URL.
    URL string `config:"proxy_url"`

    // Resolve names locally instead of on the SOCKS server.
    LocalResolve bool `config:"proxy_use_local_resolver"`
}

ProxyConfig holds the configuration information required to proxy connections through a SOCKS5 proxy server.

func (*ProxyConfig) Validate Uses

func (c *ProxyConfig) Validate() error

Directories

PathSynopsis
kerberos
tlscommon
transptest

Package transport imports 14 packages (graph). Updated 2020-08-24. Refresh now. Tools for package owners.