Documentation ¶
Index ¶
- func CreateFixedBody(bodySize int) []byte
- func DialerFun(addr string) (network.Conn, error)
- func SlowReadDialer(addr string) (network.Conn, error)
- func SlowWriteDialer(addr string) (network.Conn, error)
- type Conn
- func (m *Conn) AddCloseCallback(callback netpoll.CloseCallback) error
- func (m *Conn) Close() error
- func (m *Conn) Flush() error
- func (m *Conn) IsActive() bool
- func (m *Conn) Len() int
- func (m *Conn) LocalAddr() net.Addr
- func (m *Conn) Malloc(n int) (buf []byte, err error)
- func (m *Conn) Peek(i int) ([]byte, error)
- func (m *Conn) Read(b []byte) (n int, err error)
- func (m *Conn) ReadBinary(n int) (p []byte, err error)
- func (m *Conn) ReadByte() (byte, error)
- func (m *Conn) Reader() network.Reader
- func (m *Conn) Release() error
- func (m *Conn) RemoteAddr() net.Addr
- func (m *Conn) SetDeadline(t time.Time) error
- func (m *Conn) SetIdleTimeout(timeout time.Duration) error
- func (m *Conn) SetOnRequest(on netpoll.OnRequest) error
- func (m *Conn) SetReadDeadline(t time.Time) error
- func (m *Conn) SetReadTimeout(t time.Duration) error
- func (m *Conn) SetWriteDeadline(t time.Time) error
- func (m *Conn) SetWriteTimeout(t time.Duration) error
- func (m *Conn) Skip(n int) error
- func (m *Conn) Write(b []byte) (n int, err error)
- func (m *Conn) WriteBinary(b []byte) (n int, err error)
- func (m *Conn) Writer() network.Writer
- func (m *Conn) WriterRecorder() Recorder
- type EOFReader
- func (e *EOFReader) Len() int
- func (e *EOFReader) Peek(n int) ([]byte, error)
- func (e *EOFReader) Read(p []byte) (n int, err error)
- func (e *EOFReader) ReadBinary(n int) (p []byte, err error)
- func (e *EOFReader) ReadByte() (byte, error)
- func (e *EOFReader) Release() error
- func (e *EOFReader) Skip(n int) error
- type ExtWriter
- type Recorder
- type SlowReadConn
- type SlowWriteConn
- type StreamConn
- type ZeroCopyReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFixedBody ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) AddCloseCallback ¶
func (m *Conn) AddCloseCallback(callback netpoll.CloseCallback) error
func (*Conn) RemoteAddr ¶
func (*Conn) SetWriteTimeout ¶ added in v0.4.1
func (*Conn) WriterRecorder ¶
type SlowReadConn ¶
type SlowReadConn struct {
*Conn
}
func NewSlowReadConn ¶
func NewSlowReadConn(source string) *SlowReadConn
func (*SlowReadConn) SetReadTimeout ¶ added in v0.6.1
func (m *SlowReadConn) SetReadTimeout(t time.Duration) error
func (*SlowReadConn) SetWriteTimeout ¶ added in v0.4.1
func (m *SlowReadConn) SetWriteTimeout(t time.Duration) error
type SlowWriteConn ¶ added in v0.4.1
type SlowWriteConn struct { *Conn // contains filtered or unexported fields }
func NewSlowWriteConn ¶ added in v0.4.1
func NewSlowWriteConn(source string) *SlowWriteConn
func (*SlowWriteConn) Flush ¶ added in v0.4.1
func (m *SlowWriteConn) Flush() error
func (*SlowWriteConn) SetWriteTimeout ¶ added in v0.4.1
func (m *SlowWriteConn) SetWriteTimeout(t time.Duration) error
type StreamConn ¶
type StreamConn struct {
Data []byte
}
func NewStreamConn ¶
func NewStreamConn() *StreamConn
func (*StreamConn) Len ¶
func (m *StreamConn) Len() int
func (*StreamConn) ReadBinary ¶
func (m *StreamConn) ReadBinary(n int) (p []byte, err error)
func (*StreamConn) ReadByte ¶
func (m *StreamConn) ReadByte() (byte, error)
func (*StreamConn) Release ¶
func (m *StreamConn) Release() error
func (*StreamConn) Skip ¶
func (m *StreamConn) Skip(n int) error
type ZeroCopyReader ¶
ZeroCopyReader is used to create ZeroCopyReader for testing.
NOTE: In principle, ut should use the zcReader created by netpoll.NewReader() for mock testing, but because zcReader does not implement the io.Reader interface, the test requirements of io.Reader involved are replaced with MockZeroCopyReader
func NewZeroCopyReader ¶
func NewZeroCopyReader(r string) ZeroCopyReader
func (ZeroCopyReader) Len ¶
func (m ZeroCopyReader) Len() (length int)
func (ZeroCopyReader) ReadBinary ¶
func (m ZeroCopyReader) ReadBinary(n int) (p []byte, err error)
func (ZeroCopyReader) Release ¶
func (m ZeroCopyReader) Release() (err error)
func (ZeroCopyReader) Skip ¶
func (m ZeroCopyReader) Skip(n int) (err error)
Click to show internal directories.
Click to hide internal directories.