Add ClearDBData method to Group interface and implement it in group

This commit is contained in:
2026-02-28 11:44:30 +05:00
parent f2d851baa7
commit b1f5ce4e9b

View File

@@ -14,6 +14,7 @@ import (
type Group interface {
Analyze(group *brute_force_protection.Group, eventTime time.Time, ip net.IP, message string) (AnalysisResult, error)
ClearDBData() error
}
type group struct {
@@ -79,6 +80,10 @@ func (g *group) Analyze(group *brute_force_protection.Group, eventTime time.Time
return analysisResult, nil
}
func (g *group) ClearDBData() error {
return g.groupRepository.Clear()
}
func (g *group) analysisResult(rateLimit brute_force_protection.RateLimit, eventTime time.Time, message string, entityGroup *entity.BruteForceProtectionGroup) (AnalysisResult, *entity.BruteForceProtectionGroup) {
analysisResult := AnalysisResult{
Block: false,