muxext

package
v2.0.0-...-1fe9aa2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(scopes ...string) mux.MiddlewareFunc

func CacheMiddleware

func CacheMiddleware() mux.MiddlewareFunc

func DIMiddleware

func DIMiddleware[T any](tc di.ToContext[T], provide func() T) mux.MiddlewareFunc

func HandleFunc

func HandleFunc(router *mux.Router, path string, f http.HandlerFunc, middlewares ...mux.MiddlewareFunc) *mux.Route

func LangMiddleware

func LangMiddleware() mux.MiddlewareFunc

func NewRouter

func NewRouter() *mux.Router

func PathKey

func PathKey[T comparable](req *http.Request, name string, out key[T])

func PathParam

func PathParam(req *http.Request, name string) string

func Serve

func Serve(configs httpext.Configs, controllers []ControllerRegister, middlewares []mux.MiddlewareFunc, cors *cors.Cors)

Types

type ControllerRegister

type ControllerRegister interface {
	RegisterController(router *mux.Router)
}

Jump to

Keyboard shortcuts

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