Ajout d'une méthode d'instanciation et d'un système de regex compilable 1 seul fois (Optimisation)

This commit is contained in:
Benjamin Lejeune 2022-02-15 11:57:25 +01:00
parent 3715e752ba
commit b923a292af

View File

@ -3,14 +3,19 @@ package rules
import "_StorBackEnd/pkg/protocol" import "_StorBackEnd/pkg/protocol"
type HelloRule struct { type HelloRule struct {
cmd string
matcher *protocol.RegexMatcher
} }
func (h HelloRule) Create(cmd string, pattern string) protocol.IProtocol { func Create(cmd string, pattern string) *HelloRule {
//TODO implement me h := new(HelloRule)
panic("implement me") h.cmd = cmd
} h.matcher = protocol.CreateRegexMatcher(pattern)
func (h HelloRule) execute(data string) { return h
}
func (rule HelloRule) execute(data string) {
//TODO implement me //TODO implement me
panic("implement me") panic("implement me")
} }