stellate

package
v0.4.25 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Use

func Use(h http.Handler, mw ...Middleware) http.Handler

Types

type Chain

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

func NewChain

func NewChain(handler http.Handler, mw ...Middleware) *Chain

func (*Chain) ServeHTTP

func (c *Chain) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Chain) Then

func (c *Chain) Then(mw Middleware) *Chain

type HandlerFunc

type HandlerFunc func(http.ResponseWriter, *http.Request)

func (HandlerFunc) ServeHTTP

func (f HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Middleware

type Middleware func(http.Handler) http.Handler

func Hook

func Hook(f func(context.Context)) Middleware

Hook middleware function passes the request context to `f` function and then passes the updated context to the next handler using `WithContext`. This allows `f` to be modify the request context as needed. This can be useful for passing data or state between middleware handlers.

func LoggerMiddleware

func LoggerMiddleware() Middleware

func Recovery

func Recovery() Middleware

func (Middleware) ServeHTTP

func (mw Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RouteNode added in v0.4.6

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

type RouterMux added in v0.4.6

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

func NewRouterMux added in v0.4.6

func NewRouterMux() *RouterMux

func (*RouterMux) Handle added in v0.4.6

func (mux *RouterMux) Handle(pattern string, name string, handler http.Handler)

func (*RouterMux) HandleFunc added in v0.4.6

func (mux *RouterMux) HandleFunc(pattern string, name string, f func(http.ResponseWriter, *http.Request))

func (*RouterMux) ServeHTTP added in v0.4.6

func (mux *RouterMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*RouterMux) WithMiddleware added in v0.4.6

func (mux *RouterMux) WithMiddleware(handler http.Handler, middleware ...Middleware) http.Handler

type StellateRouter added in v0.4.6

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

func NewRouter added in v0.4.6

func NewRouter() *StellateRouter

func (*StellateRouter) AddRoute added in v0.4.6

func (t *StellateRouter) AddRoute(pattern string, name string, handler http.Handler)

func (*StellateRouter) LookupHandler added in v0.4.6

func (t *StellateRouter) LookupHandler(pattern string, method string) (http.Handler, bool)

Jump to

Keyboard shortcuts

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