remux

package
v0.0.0-...-2393f6e Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMethod    = errors.New("invalid http method")
	ErrInvalidPath      = errors.New("invalid path")
	ErrNilHandler       = errors.New("handler is nil")
	ErrAmbiguousMapping = errors.New("ambiguous mapping")
	ErrNoParams         = errors.New("no params")
)

Functions

This section is empty.

Types

type Middleware

type Middleware func(handler http.Handler) http.Handler

type Params

type Params struct {
	Named      map[string]string
	Positional []string
}

func PathParams

func PathParams(ctx context.Context) (*Params, error)

type ReMux

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

func New

func New() *ReMux

func (*ReMux) NotFound

func (r *ReMux) NotFound(handler http.Handler) error

func (*ReMux) RegisterPlain

func (r *ReMux) RegisterPlain(method, path string, handler http.Handler, middlewares ...Middleware) error

func (*ReMux) RegisterRegex

func (r *ReMux) RegisterRegex(method string, path *regexp.Regexp, handler http.Handler, middlewares ...Middleware) error

func (*ReMux) ServeHTTP

func (r *ReMux) ServeHTTP(writer http.ResponseWriter, request *http.Request)

Jump to

Keyboard shortcuts

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