Documentation ¶
Index ¶
- Variables
- func CreateChunkedBody(body []byte, trailer map[string]string, hasTrailer bool) []byte
- func CreateFixedBody(bodySize int) []byte
- func DialerFun(addr string) (network.Conn, error)
- func NewLimitReader(r *bytes.Buffer) io.LimitedReader
- func SlowReadDialer(addr string) (network.Conn, error)
- func SlowWriteDialer(addr string) (network.Conn, error)
- type BrokenConn
- type Conn
- func (m *Conn) AddCloseCallback(callback netpoll.CloseCallback) error
- func (m *Conn) Close() error
- func (m *Conn) Flush() error
- func (m *Conn) GetReadTimeout() time.Duration
- 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 ErrorReadConn
- type ExtWriter
- type OneTimeConn
- type Recorder
- type SlowReadConn
- type SlowWriteConn
- type StreamConn
- type ZeroCopyReader
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrReadTimeout = errs.New(errs.ErrTimeout, errs.ErrorTypePublic, "read timeout") ErrWriteTimeout = errs.New(errs.ErrTimeout, errs.ErrorTypePublic, "write timeout") )
Functions ¶
func CreateChunkedBody ¶ added in v0.6.7
func CreateFixedBody ¶
func NewLimitReader ¶ added in v0.6.8
func NewLimitReader(r *bytes.Buffer) io.LimitedReader
Types ¶
type BrokenConn ¶ added in v0.6.7
type BrokenConn struct {
*Conn
}
func NewBrokenConn ¶ added in v0.6.7
func NewBrokenConn(source string) *BrokenConn
func (*BrokenConn) Flush ¶ added in v0.6.7
func (o *BrokenConn) Flush() error
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) AddCloseCallback ¶
func (m *Conn) AddCloseCallback(callback netpoll.CloseCallback) error
func (*Conn) GetReadTimeout ¶ added in v0.6.7
func (*Conn) RemoteAddr ¶
func (*Conn) SetWriteTimeout ¶ added in v0.4.1
func (*Conn) WriterRecorder ¶
type ErrorReadConn ¶ added in v0.6.5
type ErrorReadConn struct { *Conn // contains filtered or unexported fields }
func NewErrorReadConn ¶ added in v0.6.5
func NewErrorReadConn(err error) *ErrorReadConn
type OneTimeConn ¶ added in v0.6.7
type OneTimeConn struct { *Conn // contains filtered or unexported fields }
func NewOneTimeConn ¶ added in v0.6.7
func NewOneTimeConn(source string) *OneTimeConn
func (*OneTimeConn) Flush ¶ added in v0.6.7
func (o *OneTimeConn) Flush() error
func (*OneTimeConn) Skip ¶ added in v0.6.7
func (o *OneTimeConn) Skip(n int) error
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.