Documentation ¶
Index ¶
- func Bind[T any](_ T) any
- func GetForm(data middleware.ContextDataStore) interface{}
- func RegisterHandleTypeProvider[T any](fn func(req *http.Request) ResponseStatusProvider)
- func SetForm(data middleware.ContextDataStore, obj interface{})
- type Combo
- type ResponseStatusProvider
- type Route
- func (r *Route) Any(pattern string, h ...interface{})
- func (r *Route) Combo(pattern string, h ...interface{}) *Combo
- func (r *Route) Delete(pattern string, h ...interface{})
- func (r *Route) Get(pattern string, h ...interface{})
- func (r *Route) GetOptions(pattern string, h ...interface{})
- func (r *Route) Group(pattern string, fn func(), middlewares ...interface{})
- func (r *Route) Head(pattern string, h ...interface{})
- func (r *Route) Methods(method, pattern string, h []any)
- func (r *Route) Mount(pattern string, subR *Route)
- func (r *Route) NotFound(h http.HandlerFunc)
- func (r *Route) Patch(pattern string, h ...interface{})
- func (r *Route) Post(pattern string, h ...interface{})
- func (r *Route) PostOptions(pattern string, h ...interface{})
- func (r *Route) Put(pattern string, h ...interface{})
- func (r *Route) RouteMethods(pattern, methods string, h ...interface{})
- func (r *Route) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Route) Use(middlewares ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetForm ¶
func GetForm(data middleware.ContextDataStore) interface{}
GetForm returns the validate form information
func RegisterHandleTypeProvider ¶ added in v1.20.0
func RegisterHandleTypeProvider[T any](fn func(req *http.Request) ResponseStatusProvider)
func SetForm ¶
func SetForm(data middleware.ContextDataStore, obj interface{})
SetForm set the form object
Types ¶
type Combo ¶
type Combo struct {
// contains filtered or unexported fields
}
Combo represents a tiny group routes with same pattern
type ResponseStatusProvider ¶ added in v1.20.0
type ResponseStatusProvider interface {
Written() bool
}
ResponseStatusProvider is an interface to check whether the response has been written by the handler
type Route ¶
Route defines a route based on chi's router
func (*Route) GetOptions ¶ added in v1.15.0
GetOptions delegate get and options method
func (*Route) NotFound ¶
func (r *Route) NotFound(h http.HandlerFunc)
NotFound defines a handler to respond whenever a route could not be found.
func (*Route) PostOptions ¶ added in v1.15.0
PostOptions delegate post and options method
func (*Route) RouteMethods ¶ added in v1.20.0
RouteMethods delegate special methods, it is an alias of "Methods", while the "pattern" is the first parameter
Click to show internal directories.
Click to hide internal directories.