Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerFunc ¶
type LoggingConn ¶
type LoggingConn struct {
net.Conn
// RW is full conversation log.
RW bytes.Buffer
// R is read data.
R bytes.Buffer
// W is written data.
W bytes.Buffer
// onClose is called when connection is closed.
// Must be used to get final conversation log.
OnClose func()
// contains filtered or unexported fields
}
LoggingConn wraps net.Conn to save conversation log.
func NewLoggingConn ¶
func NewLoggingConn(conn net.Conn) *LoggingConn
NewLoggingConn wraps net.Conn and adds logging.
func (*LoggingConn) Close ¶
func (c *LoggingConn) Close() error
Close overwrites net.Conn Close method to call onClose function.
type LoggingListener ¶
LoggingListener is net.Listener wrapper that returns wraps net.Conn with LoggingConn.
type MaxBytesConn ¶
type MaxBytesListener ¶
type Server ¶
type Server struct {
Addr string
TLSConfig *tls.Config
NotifyStartedFunc func()
ListenerWrapper func(net.Listener) net.Listener // TODO: replace with handler
Handler
}
func (*Server) ListenAndServe ¶
type TimeoutConn ¶
Click to show internal directories.
Click to hide internal directories.