Versions in this module Expand all Collapse all v1 v1.6.0 Apr 5, 2025 v1.4.0 Oct 6, 2024 Changes in this version + var ErrClosedAlready = errors.New("naza.connection: connection closed already") + var ErrConnectionPanic = errors.New("naza.connection: using in a wrong way") + var ErrWriteChanFull = errors.New("naza.connection: write channel full") + type Connection interface + Close func() error + Done func() <-chan error + Flush func() error + GetStat func() Stat + LocalAddr func() net.Addr + ModReadTimeoutMs func(n int) + ModWriteBufSize func(n int) + ModWriteChanSize func(n int) + ModWriteTimeoutMs func(n int) + Read func(b []byte) (n int, err error) + ReadAtLeast func(buf []byte, min int) (n int, err error) + ReadLine func() (line []byte, isPrefix bool, err error) + RemoteAddr func() net.Addr + SetDeadline func(t time.Time) error + SetReadDeadline func(t time.Time) error + SetWriteDeadline func(t time.Time) error + Write func(b []byte) (n int, err error) + Writev func(b net.Buffers) (n int, err error) + func New(conn net.Conn, modOptions ...ModOption) Connection + type ModOption func(option *Option) + type Option struct + ReadBufSize int + ReadTimeoutMs int + WriteBufSize int + WriteChanFullBehavior WriteChanFullBehavior + WriteChanSize int + WriteTimeoutMs int + type Stat struct + ReadBytesSum uint64 + WroteBytesSum uint64 + type StatAtomic struct + ReadBytesSum nazaatomic.Uint64 + WroteBytesSum nazaatomic.Uint64 + type WriteChanFullBehavior int + const WriteChanFullBehaviorBlock + const WriteChanFullBehaviorReturnError