Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindJSONRequest ¶
func BindJSONRequest[ T casheerapi.CreateEntryRequest | casheerapi.CreateDebtRequest | casheerapi.CreateExpenseRequest | casheerapi.UpdateExpenseRequest | casheerapi.UpdateDebtRequest | casheerapi.UpdateEntryRequest]() gin.HandlerFunc
BindJSONRequest does the same job as ctx.ShouldBindJSON, while also writing a custom error to the response if the binding is not successful.
func BindQueryParams ¶
func BindQueryParams[ T casheerapi.ListDebtParams | casheerapi.ListEntryParams | casheerapi.ListExpenseParams](paramName string) gin.HandlerFunc
BindQueryParams does the same job as ctx.ShouldBindQuery, while also writing a custom error to the response if the binding is not successful.
func ErrorHandler ¶
func ErrorHandler() gin.HandlerFunc
ErrorHandler is a middleware which gets called when errors occur inside the handlers.
func GetMultipleURLParam ¶
func GetMultipleURLParam(paramNames ...string) gin.HandlerFunc
GetMultipleURLParam is the same as GetURLParam, except it retrieves values for multiple URL parameters.
func GetURLParam ¶
func GetURLParam(paramName string) gin.HandlerFunc
GetURLParam does the same job as ctx.Param, while also writing a custom error message if the param is not found or is not a valid integer.
For now, all URL params represent identifiers, which are integers.
func JSONApiContentType ¶
func JSONApiContentType() gin.HandlerFunc
Types ¶
This section is empty.