router

package
v0.0.0-...-cfc4735 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRoutes

func InitRoutes(a *MuxRouterAdapter)

Types

type IRouter

type IRouter interface {
	HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) *mux.Route
	PathPrefix(tpl string) *mux.Route
	Use(mwf ...mux.MiddlewareFunc)
	SetNotFoundHandler(handler func(http.ResponseWriter, *http.Request))
	ServeHTTP(http.ResponseWriter, *http.Request)
}

type MuxRouterAdapter

type MuxRouterAdapter struct {
	MuxRouter       *mux.Router
	NotFoundHandler *handler2.NotFoundHandler
	IndexHandler    *handler2.IndexHandler
	Middlewares     middleware.APIMiddleware
}

func NewMuxRouterAdapter

func NewMuxRouterAdapter(
	notFoundHandler *handler2.NotFoundHandler,
	indexHandler *handler2.IndexHandler,
	middlewares middleware.APIMiddleware,
) *MuxRouterAdapter

func (MuxRouterAdapter) HandleFunc

func (a MuxRouterAdapter) HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) *mux.Route

HandleFunc HandleFunc

func (MuxRouterAdapter) PathPrefix

func (a MuxRouterAdapter) PathPrefix(tpl string) *mux.Route

PathPrefix PathPrefix

func (MuxRouterAdapter) ServeHTTP

func (a MuxRouterAdapter) ServeHTTP(writer http.ResponseWriter, request *http.Request)

ServeHTTP ServeHTTP

func (MuxRouterAdapter) SetNotFoundHandler

func (a MuxRouterAdapter) SetNotFoundHandler(handler func(http.ResponseWriter, *http.Request))

SetNotFoundHandler SetNotFoundHandler

func (MuxRouterAdapter) Use

func (a MuxRouterAdapter) Use(mwf ...mux.MiddlewareFunc)

Use Use

Jump to

Keyboard shortcuts

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