Documentation ¶
Index ¶
- Variables
- func NewMuxWithConfig(conf *Config) (modules.Handler, error)
- 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) ServeConn(ctx context.Context, conn net.Conn)
- func (m *Mux) UnmarshalJSON(data []byte) error
- type Pattern
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotAddress = errors.New("not address") ErrNotFound = errors.New("not found") )
Functions ¶
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 (*Mux) Handler ¶
Handler returns most matching handler and prefix bytes data to use for the given reader.
func (*Mux) ServeConn ¶
ServeConn dispatches the reader to the handler whose pattern most closely matches the reader.
func (*Mux) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.