Versions in this module Expand all Collapse all v1 v1.15.2 Jun 5, 2026 v1.15.1 May 30, 2026 Changes in this version + var ErrBufferTooSmall = errors.New("a message sent was larger than the buffer used to receive the message into") + var ErrListenerClosed = errors.New("use of closed listener") + var ErrNotSupported = errors.New("feature not supported") + func Ping(address string) (response []byte, err error) + func PingContext(ctx context.Context, address string) (response []byte, err error) + func PingTimeout(address string, timeout time.Duration) ([]byte, error) + type Conn struct + func Dial(address string) (*Conn, error) + func DialContext(ctx context.Context, address string) (*Conn, error) + func DialContextVersion(ctx context.Context, address string, protocolVersion byte) (*Conn, error) + func DialTimeout(address string, timeout time.Duration) (*Conn, error) + func DialTimeoutVersion(address string, timeout time.Duration, protocolVersion byte) (*Conn, error) + func DialVersion(address string, protocolVersion byte) (*Conn, error) + func (conn *Conn) Close() error + func (conn *Conn) Context() context.Context + func (conn *Conn) Latency() time.Duration + func (conn *Conn) LocalAddr() net.Addr + func (conn *Conn) Read(b []byte) (n int, err error) + func (conn *Conn) ReadPacket() (b []byte, err error) + func (conn *Conn) RemoteAddr() net.Addr + func (conn *Conn) SetDeadline(time.Time) error + func (conn *Conn) SetReadDeadline(time.Time) error + func (conn *Conn) SetWriteDeadline(time.Time) error + func (conn *Conn) Write(b []byte) (n int, err error) + type Dialer struct + ErrorLog *slog.Logger + MaxMTU uint16 + MaxTransientErrors int + ProtocolVersion byte + UpstreamDialer UpstreamDialer + func (dialer Dialer) Dial(address string) (*Conn, error) + func (dialer Dialer) DialContext(ctx context.Context, address string) (*Conn, error) + func (dialer Dialer) DialContextVersion(ctx context.Context, address string, protocolVersion byte) (*Conn, error) + func (dialer Dialer) DialTimeout(address string, timeout time.Duration) (*Conn, error) + func (dialer Dialer) DialTimeoutVersion(address string, timeout time.Duration, protocolVersion byte) (*Conn, error) + func (dialer Dialer) DialVersion(address string, protocolVersion byte) (*Conn, error) + func (dialer Dialer) Ping(address string) ([]byte, error) + func (dialer Dialer) PingContext(ctx context.Context, address string) (response []byte, err error) + func (dialer Dialer) PingTimeout(address string, timeout time.Duration) ([]byte, error) + type ListenConfig struct + BlockDuration time.Duration + DisableCookies bool + ErrorLog *slog.Logger + MaxMTU uint16 + ProtocolVersion byte + ProtocolVersions []byte + UpstreamPacketListener UpstreamPacketListener + func (conf ListenConfig) Listen(address string) (*Listener, error) + type Listener struct + func Listen(address string) (*Listener, error) + func ListenAutoVersion(address string, protocolVersions ...byte) (*Listener, error) + func ListenVersion(address string, protocolVersion byte) (*Listener, error) + func (listener *Listener) Accept() (net.Conn, error) + func (listener *Listener) Addr() net.Addr + func (listener *Listener) Block(addr net.Addr) + func (listener *Listener) Close() error + func (listener *Listener) ID() int64 + func (listener *Listener) PongData(data []byte) + type UpstreamDialer interface + DialContext func(ctx context.Context, network, address string) (net.Conn, error) + type UpstreamPacketListener interface + ListenPacket func(network, address string) (net.PacketConn, error)