Documentation
¶
Index ¶
- type Binder
- type BinderFunc
- type Controller
- type DefaultBinder
- type Handler
- type HandlerFunc
- type JSONResponder
- type Middleware
- type MiddlewareFunc
- type RedirectResponder
- type RedirectResponse
- type Resolver
- type ResolverFunc
- type Responder
- type ResponderFunc
- type Route
- type Router
- type StaticResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinderFunc ¶
BinderFunc provides a function implementation of Binder.
type Controller ¶
type Controller[Req, Res any] struct { Binder Binder[Req] Responder Responder[Res] Resolver Resolver[Req, Res] }
Controller provides a composable implementation of Handler, using a Binder, Resolver, and Responder.
type DefaultBinder ¶
type DefaultBinder[T any] struct{}
DefaultBinder binds the model type using the built-in echo.DefaultBinder.
type HandlerFunc ¶
HandlerFunc provides a function implementation of Handler.
type JSONResponder ¶
type JSONResponder[T any] struct{}
JSONResponder responds to the request by encoding the provided model type into JSON before serializing it to the response body.
type Middleware ¶
type Middleware interface {
Invoke(next echo.HandlerFunc) echo.HandlerFunc
}
Middleware wraps a request Handler, accessing and modifying the request and response values.
type MiddlewareFunc ¶
type MiddlewareFunc func(next echo.HandlerFunc) echo.HandlerFunc
MiddlewareFunc provides a function implementation of Middleware.
func (MiddlewareFunc) Invoke ¶
func (fn MiddlewareFunc) Invoke(next echo.HandlerFunc) echo.HandlerFunc
Invoke implements Middleware.
type RedirectResponder ¶
type RedirectResponder struct{}
RedirectResponder responds to the request via redirect using the parameters provided in the RedirectResponse value.
type RedirectResponse ¶
RedirectResponse provides the HTTP status code and URL necessary to perform the redirect.
type ResolverFunc ¶
ResolverFunc provides a function implementation of Resolver.
type ResponderFunc ¶
ResponderFunc provides a functions implementation of Responder.
type Route ¶
type Route struct {
Method string
Path string
Handler Handler
Middleware []Middleware
}
Route provides the parameters needed to register a given Handler in the Router.