route

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMiddleware

func AddMiddleware(
	router *mux.Router,
	middleware model.MiddlewareFunc,
)

AddMiddleware wraps the mux middleware addition function

func CreateRouter

func CreateRouter() *mux.Router

CreateRouter initializes a router for route registrations

func GetRouteInfo

func GetRouteInfo(httpRequest *http.Request) (string, model.ActionFunc, error)

GetRouteInfo retrieves the registered name and action for the given route

func HandleFunc

func HandleFunc(
	router *mux.Router,
	endpoint string,
	method string,
	path string,
	queries []string,
	handleFunc func(http.ResponseWriter, *http.Request),
	actionFunc model.ActionFunc,
) *mux.Route

HandleFunc wraps the mux route handler

func HostStatic

func HostStatic(
	router *mux.Router,
	name string,
	path string,
	handler http.Handler,
) *mux.Route

HostStatic wraps the mux static content handler

func WalkRegisteredRoutes

func WalkRegisteredRoutes(router *mux.Router) error

WalkRegisteredRoutes examines the registered router for errors

Types

This section is empty.

Jump to

Keyboard shortcuts

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