Documentation ¶
Index ¶
- Variables
- type Config
- type Mux
- func (m *Mux) Handle(pattern string, handler modules.Handler) error
- func (m *Mux) Handler(r io.Reader) (handler modules.Handler, prefix []byte, err error)
- func (m *Mux) NotFound(handler modules.Handler) error
- func (m *Mux) Pattern(name string, pattern string)
- func (m *Mux) ServeMux(ctx context.Context, conn net.Conn)
- type Pattern
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotAddress = errors.New("not address") ErrNotFound = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux 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 NewMuxWithConfig ¶
func (*Mux) Handler ¶
Handler returns most matching handler and prefix bytes data to use for the given reader.
Click to show internal directories.
Click to hide internal directories.