Documentation ¶
Index ¶
- func NewDialer() network.Dialer
- func NewTransporter(options *config.Options) network.Transporter
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) CloseNoResetBuffer() error
- func (c *Conn) Flush() (err error)
- func (c *Conn) HandleSpecificError(err error, rip string) (needIgnore bool)
- func (c *Conn) Len() int
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Malloc(n int) (buf []byte, err error)
- func (c *Conn) Peek(i int) (p []byte, err error)
- func (c *Conn) Read(b []byte) (l int, err error)
- func (c *Conn) ReadBinary(i int) ([]byte, error)
- func (c *Conn) ReadByte() (p byte, err error)
- func (c *Conn) ReadFrom(r io.Reader) (n int64, err error)
- func (c *Conn) Release() error
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetReadTimeout(t time.Duration) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) SetWriteTimeout(t time.Duration) error
- func (c *Conn) Skip(n int) error
- func (c *Conn) ToHertzError(err error) error
- func (c *Conn) Write(b []byte) (n int, err error)
- func (c *Conn) WriteBinary(b []byte) (n int, err error)
- type TLSConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTransporter ¶
func NewTransporter(options *config.Options) network.Transporter
For transporter switch
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) CloseNoResetBuffer ¶ added in v0.4.0
CloseNoResetBuffer closes the connection without reset buffer.
func (*Conn) HandleSpecificError ¶ added in v0.6.1
func (*Conn) Peek ¶
Peek returns the next n bytes without advancing the reader. The bytes stop being valid at the next read call. If Peek returns fewer than n bytes, it also returns an error explaining why the read is short.
func (*Conn) ReadBinary ¶
ReadBinary is used to read next n byte with copy, and the read pointer will be advanced.
func (*Conn) ReadFrom ¶
ReadFrom implements io.ReaderFrom. If the underlying writer supports the ReadFrom method, and c has no buffered data yet, this calls the underlying ReadFrom without buffering.
func (*Conn) Release ¶
Release release linkBuffer.
NOTE: This function should only be called in inputBuffer.
func (*Conn) RemoteAddr ¶
RemoteAddr returns the remote address of the connection.
func (*Conn) SetDeadline ¶
SetDeadline sets the connection deadline.
func (*Conn) SetReadDeadline ¶
SetReadDeadline sets the read deadline of the connection.
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline sets the write deadline of the connection.