Documentation ¶
Index ¶
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) New() *Conn
- func (c *Conn) Read(b []byte) (n int, err 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) SetWriteDeadline(t time.Time) error
- func (c *Conn) WithClose(fn func(conn net.Conn) func() error) *Conn
- func (c *Conn) WithLocalAddr(fn func(conn net.Conn) func() net.Addr) *Conn
- func (c *Conn) WithRead(fn func(conn net.Conn) func([]byte) (int, error)) *Conn
- func (c *Conn) WithRemoteAddr(fn func(conn net.Conn) func() net.Addr) *Conn
- func (c *Conn) WithSetDeadline(fn func(conn net.Conn) func(t time.Time) error) *Conn
- func (c *Conn) WithSetReadDeadline(fn func(conn net.Conn) func(t time.Time) error) *Conn
- func (c *Conn) WithSetWriteDeadline(fn func(conn net.Conn) func(t time.Time) error) *Conn
- func (c *Conn) WithWrite(fn func(conn net.Conn) func([]byte) (int, error)) *Conn
- func (c *Conn) Write(b []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a net.Conn which extends the behavior of another net.Conn implementation.
func (*Conn) New ¶
New wraps a Conn within a new Conn to allow for multiple of the same function to be chained/layered together. This is particularly useful when dealing with messages that include multiple headers.
e.g. c.WithRead(fna).New().WithRead(fnb).New() and so on...
func (*Conn) RemoteAddr ¶
RemoteAddr runs the RemoteAddr method on the conn
func (*Conn) SetDeadline ¶
SetDeadline runs the SetDeadline method on the conn
func (*Conn) SetReadDeadline ¶
SetReadDeadline runs the SetReadDeadline method on the conn
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline runs the SetWriteDeadline method on the conn
func (*Conn) WithLocalAddr ¶
WithLocalAddr overrides the LocalAddr method on the Conn
func (*Conn) WithRemoteAddr ¶
WithRemoteAddr overrides the RemoteAddr method on the Conn
func (*Conn) WithSetDeadline ¶
WithSetDeadline overrides the SetDeadline method on the Conn
func (*Conn) WithSetReadDeadline ¶
WithSetReadDeadline overrides the SetReadDeadline method on the Conn
func (*Conn) WithSetWriteDeadline ¶
WithSetWriteDeadline overrides the SetWriteDeadline method on the Conn