Documentation ¶
Index ¶
- Variables
- func DialContext(ctx context.Context, c Config, network, address string) (net.Conn, error)
- func DialWith(ctx context.Context, dialer Dialer, network, host string, addresses []string, ...) (c net.Conn, err error)
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect() error
- func (c *Client) ConnectContext(ctx context.Context) error
- func (c *Client) Host() string
- func (c *Client) IsConnected() bool
- func (c *Client) LocalAddr() net.Addr
- func (c *Client) Read(b []byte) (int, error)
- func (c *Client) RemoteAddr() net.Addr
- func (c *Client) SetDeadline(t time.Time) error
- func (c *Client) SetReadDeadline(t time.Time) error
- func (c *Client) SetWriteDeadline(t time.Time) error
- func (c *Client) String() string
- func (c *Client) Test(d testing.Driver)
- func (c *Client) Write(b []byte) (int, error)
- type Config
- type Dialer
- func ConnWrapper(d Dialer, w func(net.Conn) net.Conn) Dialer
- func LoggingDialer(d Dialer, logger *logp.Logger) Dialer
- func MakeDialer(c Config) (Dialer, error)
- func NetDialer(timeout time.Duration) Dialer
- func ProxyDialer(log *logp.Logger, config *ProxyConfig, forward Dialer) (Dialer, error)
- func StatsDialer(d Dialer, s IOStatser) Dialer
- func TLSDialer(forward Dialer, config *tlscommon.TLSConfig, timeout time.Duration) Dialer
- func TestNetDialer(d testing.Driver, timeout time.Duration) Dialer
- func TestTLSDialer(d testing.Driver, forward Dialer, config *tlscommon.TLSConfig, ...) Dialer
- func TestUnixDialer(d testing.Driver, timeout time.Duration, sockFile string) Dialer
- func UnixDialer(timeout time.Duration, sockFile string) Dialer
- type DialerFunc
- type DialerFuncH2
- type DialerH2
- type IOStatser
- type PipeListener
- type ProxyConfig
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotConnected = errors.New("client is not connected")
)
Functions ¶
func DialContext ¶ added in v0.8.0
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientWithDialer ¶
func (*Client) ConnectContext ¶ added in v0.8.0
func (*Client) IsConnected ¶
func (*Client) RemoteAddr ¶
type Dialer ¶
type Dialer interface { Dial(network, address string) (net.Conn, error) DialContext(ctx context.Context, network, address string) (net.Conn, error) }
func MakeDialer ¶
func ProxyDialer ¶
func StatsDialer ¶
func TestTLSDialer ¶
func TestUnixDialer ¶
TestUnixDialer creates a Test Unix Dialer when using domain socket.
type DialerFunc ¶
func (DialerFunc) DialContext ¶ added in v0.8.0
type DialerFuncH2 ¶
type DialerH2 ¶
type DialerH2 interface {
DialContext(ctx context.Context, network, address string, cfg *tls.Config) (net.Conn, error)
}
func TLSDialerH2 ¶
type PipeListener ¶
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 ¶
func NewPipeListener() *PipeListener
NewPipeListener returns a new PipeListener.
func (*PipeListener) Accept ¶
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 ¶
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 ¶
func (l *PipeListener) Close() error
Close closes the listener. This is part of the net.PipeListener interface.
func (*PipeListener) DialContext ¶
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 ¶
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 ¶
func (c *ProxyConfig) Validate() error