Ajout d'une méthode d'instanciation et d'un système de regex compilable 1 seul fois (Optimisation)
This commit is contained in:
parent
3715e752ba
commit
b923a292af
@ -3,14 +3,19 @@ package rules
|
||||
import "_StorBackEnd/pkg/protocol"
|
||||
|
||||
type HelloRule struct {
|
||||
cmd string
|
||||
matcher *protocol.RegexMatcher
|
||||
}
|
||||
|
||||
func (h HelloRule) Create(cmd string, pattern string) protocol.IProtocol {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (h HelloRule) execute(data string) {
|
||||
func Create(cmd string, pattern string) *HelloRule {
|
||||
h := new(HelloRule)
|
||||
h.cmd = cmd
|
||||
h.matcher = protocol.CreateRegexMatcher(pattern)
|
||||
|
||||
return h
|
||||
}
|
||||
|
||||
func (rule HelloRule) execute(data string) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user