cache

package
v0.0.0-...-0edcfba Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

Check implements BruteForceChecker.

type HighTrafficChecker

type HighTrafficChecker struct {
	// contains filtered or unexported fields
}

func NewHighTrafficChecker

func NewHighTrafficChecker(cmd redis.Cmdable) *HighTrafficChecker

func (*HighTrafficChecker) Check

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

func (*RedisAlertCache) SetAlerts

func (r *RedisAlertCache) SetAlerts(
	ctx context.Context,
	alertType string,
	alerts []domain.Alert,
) error

SetAlerts implements AlertCache.

type RedisRateLimitChecker

type RedisRateLimitChecker struct {
	// contains filtered or unexported fields
}

func (*RedisRateLimitChecker) Check

Check implements RateLimitChecker.

func (*RedisRateLimitChecker) Key

func (r *RedisRateLimitChecker) Key(ip string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL