Versions in this module Expand all Collapse all v0 v0.1.0 Feb 13, 2023 Changes in this version + const ErrLoadIPLocationDBCode + var JWTAuthHeader = "Authorization" + var JWTAuthTokenType = "Bearer" + var RedisRateLimitRemainingHeader = "X-Redis-Rate-Limiter-Remaining" + var RedisRateLimitRetryAfterHeader = "X-Redis-Rate-Limiter-Retry-After" + var RequestIDHeader = "X-Request-ID" + func IPFilter(options IPFilterOptions) gin.HandlerFunc + func JWTAuth(options JWTAuthOptions) gin.HandlerFunc + func LoadIPLocationDB(ctx context.Context, path string) (*ip2location.DB, error) + func Localizer(options LocalizerOptions) gin.HandlerFunc + func Logger(excludeRequests ExcludeHTTPRequests, extraFields ...string) gin.HandlerFunc + func Recover(handler RecoveryHandler) gin.HandlerFunc + func RedisRateLimiter(options RedisRateLimiterOptions) gin.HandlerFunc + func RedisSession(options RedisSessionOptions) gin.HandlerFunc + func RequestID() gin.HandlerFunc + type ErrLoadIPLocationDB struct + Err error + Path string + func (e *ErrLoadIPLocationDB) Code() int + func (e *ErrLoadIPLocationDB) Error() string + func (e *ErrLoadIPLocationDB) InternalError() error + type ErrorHandler func(*gin.Context, string, error) bool + type ExcludeHTTPRequest struct + Method string + Path string + func (r *ExcludeHTTPRequest) Set(str string) error + func (r *ExcludeHTTPRequest) String() string + func (r *ExcludeHTTPRequest) Type() string + type ExcludeHTTPRequests []ExcludeHTTPRequest + func (r *ExcludeHTTPRequests) Set(str string) error + func (r ExcludeHTTPRequests) String() string + func (r ExcludeHTTPRequests) Type() string + type IPAddressRecord struct + Address string + CountryCode string + CountryName string + type IPFilterOptions struct + ClientIPLookupHandler func(*gin.Context) (string, error) + EnableErrorCodeHeader bool + EnableErrorMessageHeader bool + ErrorHandler ErrorHandler + IPDBHandle *ip2location.DB + IsBannedHandler func(*gin.Context, IPAddressRecord) bool + func (o IPFilterOptions) GetErrorCodeHeader() string + func (o IPFilterOptions) GetErrorMessageHeader() string + func (o IPFilterOptions) SetErrorCodeHeader() bool + func (o IPFilterOptions) SetErrorMessageHeader() bool + type JWTAuthHandler func(*gin.Context, *jwt.Token) (bool, error) + type JWTAuthOptions struct + AuthService crypto.JWTAuthService + AuthnHandler JWTAuthHandler + AuthzHandler JWTAuthHandler + Cookie struct{ ... } + EnableErrorCodeHeader bool + EnableErrorMessageHeader bool + ErrorHandler ErrorHandler + SaveToCookie bool + func (o JWTAuthOptions) GetErrorCodeHeader() string + func (o JWTAuthOptions) GetErrorMessageHeader() string + func (o JWTAuthOptions) SetErrorCodeHeader() bool + func (o JWTAuthOptions) SetErrorMessageHeader() bool + type LocalizerOptions struct + EnableErrorCodeHeader bool + EnableErrorMessageHeader bool + ErrorHandler ErrorHandler + Translator *i18n.UniversalTranslator + func (o LocalizerOptions) GetErrorCodeHeader() string + func (o LocalizerOptions) GetErrorMessageHeader() string + func (o LocalizerOptions) SetErrorCodeHeader() bool + func (o LocalizerOptions) SetErrorMessageHeader() bool + type RecoveryHandler func(*gin.Context, error, string) + type RedisRateLimiterOptions struct + Client *redis.Client + EnableErrorCodeHeader bool + EnableErrorMessageHeader bool + ErrorHandler ErrorHandler + KeyLookupHandler func(*gin.Context) string + Rate redisrate.Limit + func (o RedisRateLimiterOptions) GetErrorCodeHeader() string + func (o RedisRateLimiterOptions) GetErrorMessageHeader() string + func (o RedisRateLimiterOptions) SetErrorCodeHeader() bool + func (o RedisRateLimiterOptions) SetErrorMessageHeader() bool + type RedisSessionOptions struct + Client *redis.Client + EnableErrorCodeHeader bool + EnableErrorMessageHeader bool + ErrorHandler ErrorHandler + SessionIDLookupHandler func(*gin.Context) (string, error) + TTL time.Duration + func (o RedisSessionOptions) GetErrorCodeHeader() string + func (o RedisSessionOptions) GetErrorMessageHeader() string + func (o RedisSessionOptions) SetErrorCodeHeader() bool + func (o RedisSessionOptions) SetErrorMessageHeader() bool