Documentation ¶
Index ¶
- type Attr
- type MiddlewareFunc
- type Route
- type Router
- func (r *Router) Delete(path string, handler http.Handler) *Route
- func (r *Router) Get(path string, handler http.Handler) *Route
- func (r *Router) Group(prefix string, cb func(r *Router))
- func (r *Router) Handle(p string, handler http.Handler) *Route
- func (r *Router) Patch(path string, handler http.Handler) *Route
- func (r *Router) Post(path string, handler http.Handler) *Route
- func (r *Router) PrintRoutes()
- func (r *Router) Put(path string, handler http.Handler) *Route
- func (r *Router) Register(dp *di.DependencyProvider)
- func (r *Router) Routes() []*Route
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) Use(middleware MiddlewareFunc)
- func (r *Router) WithDependencyProvider(dp *di.DependencyProvider)
- type SalusaResolver
- type URLResolver
- type WithDependencyProvider
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MiddlewareFunc ¶
type MiddlewareFunc = mux.MiddlewareFunc
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Example ¶
package main import ( "github.com/abibby/salusa/request" "github.com/abibby/salusa/router" ) func main() { r := router.New() r.Group("/test", func(r *router.Router) { r.Get("/", request.Handler(func(r *any) (any, error) { return nil, nil })) }) }
Output:
func (*Router) PrintRoutes ¶ added in v0.8.0
func (r *Router) PrintRoutes()
func (*Router) Register ¶ added in v0.8.0
func (r *Router) Register(dp *di.DependencyProvider)
func (*Router) Use ¶
func (r *Router) Use(middleware MiddlewareFunc)
func (*Router) WithDependencyProvider ¶ added in v0.8.0
func (r *Router) WithDependencyProvider(dp *di.DependencyProvider)
type SalusaResolver ¶ added in v0.8.0
type SalusaResolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶ added in v0.8.0
func NewResolver(origin string, r *Router) *SalusaResolver
func (*SalusaResolver) Resolve ¶ added in v0.8.0
func (r *SalusaResolver) Resolve(name string, params ...any) string
func (*SalusaResolver) ResolveHandler ¶ added in v0.8.0
func (r *SalusaResolver) ResolveHandler(h http.Handler, params ...any) string
type URLResolver ¶ added in v0.8.0
type WithDependencyProvider ¶ added in v0.8.0
type WithDependencyProvider interface {
WithDependencyProvider(dp *di.DependencyProvider)
}
Click to show internal directories.
Click to hide internal directories.