Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn interface { // Context returns a user-defined context. Context() interface{} // SetContext sets a user-defined context. SetContext(interface{}) // AddrIndex is the index of server addr that was passed to the Serve call. AddrIndex() int // LocalAddr is the connection's local socket address. LocalAddr() net.Addr // RemoteAddr is the connection's remote peer address. RemoteAddr() net.Addr // Write data to connection. Write(data []byte) // Close the connection. Close() }
Conn ...
type Events ¶
type Events struct { // Serving fires when the server can accept connections. The server // parameter has information and various utilities. Serving func(server Server) (action Action) // Opened fires when a new connection has opened. // The info parameter has information about the connection such as // it's local and remote address. // Use the out return value to write data to the connection. Opened func(c Conn) (out []byte, action Action) // Closed fires when a connection has closed. // The err parameter is the last known connection error. Closed func(c Conn) (action Action) // PreWrite fires just before any data is written to any client socket. PreWrite func() // Data fires when a connection sends the server data. // The in parameter is the incoming data. // Use the out return value to write data to the connection. Data func(c Conn, in []byte) (out []byte, action Action) // Tick fires immediately after the server starts and will fire again // following the duration specified by the delay return value. Tick func(now time.Time) (delay time.Duration, action Action) }
Events ...
Click to show internal directories.
Click to hide internal directories.