traefik/tcp/handler.go
Julien Salleyron 4a68d29ce2 Add a new protocol
Co-authored-by: Gérald Croës <gerald@containo.us>
2019-03-14 09:30:04 +01:00

19 lines
338 B
Go

package tcp
import (
"net"
)
// Handler is the TCP Handlers interface
type Handler interface {
ServeTCP(conn net.Conn)
}
// The HandlerFunc type is an adapter to allow the use of
// ordinary functions as handlers.
type HandlerFunc func(conn net.Conn)
// ServeTCP serves tcp
func (f HandlerFunc) ServeTCP(conn net.Conn) {
f(conn)
}