httptreemux

package
v2.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package httptreemux provides some basic implementations for building routers based on dimfeld/httptreemux

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfig

func DefaultConfig(pf proxy.Factory, logger logging.Logger) mux.Config

DefaultConfig returns the struct that collects the parts the router should be built from

func DefaultFactory

func DefaultFactory(pf proxy.Factory, logger logging.Logger) router.Factory

DefaultFactory returns a net/http mux router factory with the injected proxy factory and logger

func ParamsExtractor

func ParamsExtractor(r *http.Request) map[string]string

Types

type Engine

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

func NewEngine

func NewEngine(m *httptreemux.ContextMux) Engine

func (Engine) Handle

func (g Engine) Handle(pattern, method string, handler http.Handler)

Handle implements the mux.Engine interface from the lura router package

func (Engine) ServeHTTP

func (g Engine) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the http:Handler interface from the stdlib

Jump to

Keyboard shortcuts

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