Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrListenerClosed = fmt.Errorf("listener closed")
View Source
var (
ErrNotFound = fmt.Errorf("error not found")
)
Functions ¶
Types ¶
type CMux ¶
type CMux struct {
// contains filtered or unexported fields
}
CMux is an Applicative protocol multiplexer It matches the prefix of each incoming reader against a list of registered patterns and calls the handler for the pattern that most closely matches the Handler.
func (*CMux) HandlePrefix ¶
HandlePrefix handle the handler that matches the prefix
func (*CMux) Handler ¶
Handler returns most matching handler and prefix bytes data to use for the given reader.
type HandlerFunc ¶
func (HandlerFunc) ServeConn ¶
func (h HandlerFunc) ServeConn(conn net.Conn)
type MuxListener ¶
type MuxListener struct { ErrHandler func(err error) bool // contains filtered or unexported fields }
MuxListener is a multiplexer for network connections
func NewMuxListener ¶
func NewMuxListener(listener net.Listener) *MuxListener
NewMuxListener create a new MuxListener.
func (*MuxListener) MatchPrefix ¶
func (m *MuxListener) MatchPrefix(prefixes ...string) (net.Listener, error)
MatchPrefix returns the net.Listener that matches the prefix
Click to show internal directories.
Click to hide internal directories.