Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLimitFromRequest ¶
GetLimitFromRequest : returns the value of the request parameter "limit".
func GetOffsetFromRequest ¶
GetOffsetFromRequest : returns the value of the request parameter "offset".
func VerifyLimitAndOffset ¶
func VerifyLimitAndOffset(defaultOffset, defaultLimit, maxLimit int) gin.HandlerFunc
VerifyLimitAndOffset : verify the request parameters "limit" and "offset".
func VerifyLocaleParameter ¶
func VerifyLocaleParameter(cfg Config) gin.HandlerFunc
VerifyLocaleParameter : verify the parameter "locale".
func VerifyURLParameter ¶
func VerifyURLParameter(cfg Config) gin.HandlerFunc
VerifyURLParameter : verify that a URL parameter is present and its format.
Types ¶
type Config ¶
type Config struct { Name string // The key of the URL parameter to verify. SkipVerifyingInvalidObjectID bool StoreKey string // The key which in the context the value is stored. MessageKey string // The key of the error message. NotFoundReasonKey string // The key of the reason of the error "not found". NotFoundRecoveryKey string // The key of the recovery of the error "not found". InvalidObjectIDReasonKey string // The key of the reason of the error "invalid object ID". InvalidObjectIDRecoveryKey string // The key of the recovery of the error "invalid object ID". }
Config : the configuration of a middleware.
Click to show internal directories.
Click to hide internal directories.