Préparation mécanisme d'exécution d'une command read

This commit is contained in:
2022-02-20 12:35:05 +01:00
parent 957e6500a1
commit a8d6197b60
5 changed files with 81 additions and 7 deletions

View File

@@ -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)
}