Documentation
¶
Index ¶
- func GetHTTPRouterParams(r *http.Request) httprouter.Params
- func NewBunRouterAdapter() forge.RouterAdapter
- func NewChiAdapter() forge.RouterAdapter
- func NewHTTPRouterAdapter() forge.RouterAdapter
- type BunRouterAdapter
- func (a *BunRouterAdapter) Close() error
- func (a *BunRouterAdapter) Handle(method, path string, handler http.Handler)
- func (a *BunRouterAdapter) Mount(path string, handler http.Handler)
- func (a *BunRouterAdapter) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (a *BunRouterAdapter) UseGlobal(middleware func(http.Handler) http.Handler)
- type ChiAdapter
- func (a *ChiAdapter) Close() error
- func (a *ChiAdapter) Handle(method, path string, handler http.Handler)
- func (a *ChiAdapter) Mount(path string, handler http.Handler)
- func (a *ChiAdapter) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (a *ChiAdapter) UseGlobal(middleware func(http.Handler) http.Handler)
- type HTTPRouterAdapter
- func (a *HTTPRouterAdapter) Close() error
- func (a *HTTPRouterAdapter) Handle(method, path string, handler http.Handler)
- func (a *HTTPRouterAdapter) Mount(path string, handler http.Handler)
- func (a *HTTPRouterAdapter) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (a *HTTPRouterAdapter) UseGlobal(middleware func(http.Handler) http.Handler)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHTTPRouterParams ¶
func GetHTTPRouterParams(r *http.Request) httprouter.Params
GetHTTPRouterParams retrieves httprouter params from context.
func NewBunRouterAdapter ¶
func NewBunRouterAdapter() forge.RouterAdapter
NewBunRouterAdapter creates a BunRouter adapter (default).
func NewChiAdapter ¶
func NewChiAdapter() forge.RouterAdapter
NewChiAdapter creates a Chi router adapter.
func NewHTTPRouterAdapter ¶
func NewHTTPRouterAdapter() forge.RouterAdapter
NewHTTPRouterAdapter creates an HTTPRouter adapter.
Types ¶
type BunRouterAdapter ¶
type BunRouterAdapter struct {
// contains filtered or unexported fields
}
BunRouterAdapter wraps uptrace/bunrouter.
func (*BunRouterAdapter) Close ¶
func (a *BunRouterAdapter) Close() error
Close cleans up resources.
func (*BunRouterAdapter) Handle ¶
func (a *BunRouterAdapter) Handle(method, path string, handler http.Handler)
Handle registers a route.
func (*BunRouterAdapter) Mount ¶
func (a *BunRouterAdapter) Mount(path string, handler http.Handler)
Mount registers a sub-handler.
func (*BunRouterAdapter) ServeHTTP ¶
func (a *BunRouterAdapter) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP dispatches requests.
func (*BunRouterAdapter) UseGlobal ¶ added in v0.7.0
func (a *BunRouterAdapter) UseGlobal(middleware func(http.Handler) http.Handler)
UseGlobal registers global middleware that runs before routing. This middleware will run for ALL requests, even those that don't match any route. This is critical for CORS preflight handling.
type ChiAdapter ¶
type ChiAdapter struct {
// contains filtered or unexported fields
}
ChiAdapter wraps go-chi/chi router.
func (*ChiAdapter) Handle ¶
func (a *ChiAdapter) Handle(method, path string, handler http.Handler)
Handle registers a route.
func (*ChiAdapter) Mount ¶
func (a *ChiAdapter) Mount(path string, handler http.Handler)
Mount registers a sub-handler.
func (*ChiAdapter) ServeHTTP ¶
func (a *ChiAdapter) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP dispatches requests.
func (*ChiAdapter) UseGlobal ¶ added in v0.7.0
func (a *ChiAdapter) UseGlobal(middleware func(http.Handler) http.Handler)
UseGlobal registers global middleware that runs before routing. This middleware will run for ALL requests, even those that don't match any route. This is critical for CORS preflight handling.
type HTTPRouterAdapter ¶
type HTTPRouterAdapter struct {
// contains filtered or unexported fields
}
HTTPRouterAdapter wraps julienschmidt/httprouter.
func (*HTTPRouterAdapter) Close ¶
func (a *HTTPRouterAdapter) Close() error
Close cleans up resources.
func (*HTTPRouterAdapter) Handle ¶
func (a *HTTPRouterAdapter) Handle(method, path string, handler http.Handler)
Handle registers a route.
func (*HTTPRouterAdapter) Mount ¶
func (a *HTTPRouterAdapter) Mount(path string, handler http.Handler)
Mount registers a sub-handler.
func (*HTTPRouterAdapter) ServeHTTP ¶
func (a *HTTPRouterAdapter) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP dispatches requests.
func (*HTTPRouterAdapter) UseGlobal ¶ added in v0.7.0
func (a *HTTPRouterAdapter) UseGlobal(middleware func(http.Handler) http.Handler)
UseGlobal registers global middleware that runs before routing. This middleware will run for ALL requests, even those that don't match any route. This is critical for CORS preflight handling.