Préparation mécanisme d'exécution d'une command read
This commit is contained in:
@@ -20,12 +20,15 @@ func CreateEraseFileRule(cmd string, pattern string) *EraseFileRule {
|
||||
}
|
||||
}
|
||||
|
||||
func (rule EraseFileRule) execute(data string) {
|
||||
matcher := rule.matcher
|
||||
func (rule EraseFileRule) Execute(data string) string {
|
||||
|
||||
if matcher.Match(data) {
|
||||
println("EraseFileRule data is matching")
|
||||
if rule.Match(data) {
|
||||
return "Parsing : EraseFileRule command fichier supprimé"
|
||||
} else {
|
||||
println("EraseFileRule data isn't matching")
|
||||
return "Parsing : EraseFileRule command fichier non-supprimé"
|
||||
}
|
||||
}
|
||||
|
||||
func (rule EraseFileRule) Match(data string) bool {
|
||||
return rule.matcher.Match(data)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user