diff --git a/pkg/protocol/rules/HelloRule.go b/pkg/protocol/rules/HelloRule.go index 6f294a0..9da5f75 100644 --- a/pkg/protocol/rules/HelloRule.go +++ b/pkg/protocol/rules/HelloRule.go @@ -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") }