mux

package
v0.0.2-rc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type Mux

type Mux struct {
	// contains filtered or unexported fields
}

Mux is an path protocol multiplexer.

func NewMux

func NewMux() *Mux

NewMux create a new Mux.

func (*Mux) Handle

func (m *Mux) Handle(pattern string, handler modules.Handler) error

Handle registers the handler for the given pattern in the Mux.

func (*Mux) Handler

func (m *Mux) Handler(r []byte) (handler modules.Handler, path []byte, err error)

Handler returns most matching handler and prefix bytes data to use for the given reader.

func (*Mux) NotFound

func (m *Mux) NotFound(handler modules.Handler) error

NotFound replies to the handler with an Handler not found error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL