Documentation
¶
Index ¶
- type AlertCache
- type BruteForceChecker
- type HighTrafficChecker
- type RateLimitChecker
- type RedisAlertCache
- func (r *RedisAlertCache) DeleteAlerts(ctx context.Context, alertType string) error
- func (r *RedisAlertCache) GetAlerts(ctx context.Context, alertType string) ([]domain.Alert, error)
- func (r *RedisAlertCache) Key(alertType string) string
- func (r *RedisAlertCache) SetAlerts(ctx context.Context, alertType string, alerts []domain.Alert) error
- type RedisRateLimitChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertCache ¶
type AlertCache interface { GetAlerts(ctx context.Context, alertType string) ([]domain.Alert, error) SetAlerts(ctx context.Context, alertType string, alerts []domain.Alert) error DeleteAlerts(ctx context.Context, alertType string) error }
func NewRedisAlertCache ¶
func NewRedisAlertCache(cmd redis.Cmdable) AlertCache
type BruteForceChecker ¶
type BruteForceChecker struct {
// contains filtered or unexported fields
}
func NewBruteForceChecker ¶
func NewBruteForceChecker(cmd redis.Cmdable) *BruteForceChecker
func (*BruteForceChecker) Check ¶
func (r *BruteForceChecker) Check( ctx context.Context, log domain.AccessLog, ) (domain.SecurityEvent, error)
Check implements BruteForceChecker.
type HighTrafficChecker ¶
type HighTrafficChecker struct {
// contains filtered or unexported fields
}
func NewHighTrafficChecker ¶
func NewHighTrafficChecker(cmd redis.Cmdable) *HighTrafficChecker
func (*HighTrafficChecker) Check ¶
func (r *HighTrafficChecker) Check( ctx context.Context, log domain.AccessLog, ) (domain.SecurityEvent, error)
Check implements HighTrafficChecker.
type RateLimitChecker ¶
type RateLimitChecker interface {
Check(ctx context.Context, log domain.AccessLog) (domain.SecurityEvent, error)
}
func NewRateLimitChecker ¶
func NewRateLimitChecker( cmd redis.Cmdable, name string, limit int, windowSize int64, ) RateLimitChecker
type RedisAlertCache ¶
type RedisAlertCache struct {
// contains filtered or unexported fields
}
func (*RedisAlertCache) DeleteAlerts ¶
func (r *RedisAlertCache) DeleteAlerts(ctx context.Context, alertType string) error
DeleteAlerts implements AlertCache.
func (*RedisAlertCache) GetAlerts ¶
func (r *RedisAlertCache) GetAlerts( ctx context.Context, alertType string, ) ([]domain.Alert, error)
GetAlerts implements AlertCache.
func (*RedisAlertCache) Key ¶
func (r *RedisAlertCache) Key(alertType string) string
type RedisRateLimitChecker ¶
type RedisRateLimitChecker struct {
// contains filtered or unexported fields
}
func (*RedisRateLimitChecker) Check ¶
func (r *RedisRateLimitChecker) Check( ctx context.Context, log domain.AccessLog, ) (domain.SecurityEvent, error)
Check implements RateLimitChecker.
func (*RedisRateLimitChecker) Key ¶
func (r *RedisRateLimitChecker) Key(ip string) string
Click to show internal directories.
Click to hide internal directories.