Documentation ¶
Index ¶
- func BindDeleteData(ctx Context) (*model.DeleteData, error)
- func BindPost(ctx Context) (*model.Post, error)
- func BindUpdateData(ctx Context) (*model.UpdateData, error)
- func GetID(ctx Context) (uint64, error)
- func SendCreated(ctx Context, data *model.DeleteData) error
- func SendOK(ctx Context, data interface{}) error
- type App
- type Context
- type HTTPError
- type HandlerFunc
- type MiddlewareFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindDeleteData ¶
func BindDeleteData(ctx Context) (*model.DeleteData, error)
BindDeleteData returns a delete data struct extracted from the body and an error to be checked in the handler.
func BindPost ¶
BindPost returns a post struct extracted from the body and an error to be checked in the handler.
func BindUpdateData ¶
func BindUpdateData(ctx Context) (*model.UpdateData, error)
BindUpdateData returns a update data struct extracted from the body and an error to be checked in the handler.
func GetID ¶
GetID gets the ID param from the URL and is returned with an error to be checked in the handler.
func SendCreated ¶
func SendCreated(ctx Context, data *model.DeleteData) error
SendCreated sends a JSON 201 Created response with a delete code struct as the body.
Types ¶
type HandlerFunc ¶
type HandlerFunc = echo.HandlerFunc
HandlerFunc is a type alias for "echo.HandlerFunc".
type MiddlewareFunc ¶
type MiddlewareFunc = echo.MiddlewareFunc
MiddlewareFunc is a type alias for "echo.MiddlewareFunc".
func CORS ¶
func CORS(methods ...string) MiddlewareFunc
CORS returns a CORS middleware given the allowed methods.
func CheckHeader ¶
func CheckHeader(expectedContentType string) MiddlewareFunc
CheckHeader validates the request header.
func RateLimiter ¶
func RateLimiter(ipRateLimiter *limiter.Limiter) MiddlewareFunc
RateLimiter sets and configures a rate limiter.
func RemoveTrailingSlash ¶
func RemoveTrailingSlash() MiddlewareFunc
RemoveTrailingSlash removes the trailing slash from URLs.