Add ClearDBData method to Group interface and implement it in group
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user