Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
ErrCloseConnection must be returned by a LineHandler when we want to cleanly terminate the connection without raising an error.
Functions ¶
Types ¶
type Conn ¶
type LineHandler ¶
type LineHandler interface {
ServeLine(context.Context, LineResponseWriter, []byte) error
}
LineHandler is the handler for LineServer.
type LineResponseWriter ¶
type LineResponseWriter interface { // WriteLine writes a response as a single line (the line // terminator is added by the function). WriteLine(...[]byte) error }
LineResponseWriter writes a single-line response to the underlying connection.
type LineServer ¶
type LineServer struct { IdleTimeout time.Duration WriteTimeout time.Duration RequestTimeout time.Duration // contains filtered or unexported fields }
LineServer implements a line-based text protocol. It satisfies the Handler interface.
func NewLineServer ¶
func NewLineServer(h LineHandler) *LineServer
NewLineServer returns a new LineServer with the given handler and default I/O timeouts.
func (*LineServer) ServeConnection ¶
func (l *LineServer) ServeConnection(c *Conn)
ServeConnection handles a new connection. It will accept multiple requests on the same connection (or not, depending on the client preference).
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.