- Changement des entêtes dans le projets.
This commit is contained in:
@@ -27,6 +27,10 @@ func (rule HelloRule) GetCmd() string {
|
||||
}
|
||||
|
||||
// Execute the Rule with a string command.
|
||||
func (rule HelloRule) Execute(argsData ...string) (string, bool) {
|
||||
return rule.matcher.Build(HelloRulePrefix, argsData...)
|
||||
func (rule HelloRule) Execute(argsData ...string) *protocol.ProtocolWriterResult {
|
||||
cmd, _ := rule.matcher.Build(HelloRulePrefix, argsData...)
|
||||
|
||||
return &protocol.ProtocolWriterResult{
|
||||
Cmd: cmd,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package writers
|
||||
|
||||
import "StoreBackEnd/pkg/protocol"
|
||||
import (
|
||||
"StoreBackEnd/pkg/protocol"
|
||||
)
|
||||
|
||||
// SendErrorRulePrefix Rule command prefix
|
||||
const SendErrorRulePrefix = "SEND_ERROR"
|
||||
@@ -27,6 +29,17 @@ func (rule SendErrorRule) GetCmd() string {
|
||||
}
|
||||
|
||||
// Execute the Rule with a string command.
|
||||
func (rule SendErrorRule) Execute(argsData ...string) (string, bool) {
|
||||
return rule.matcher.Build(SendErrorRulePrefix, argsData...)
|
||||
func (rule SendErrorRule) Execute(argsData ...string) *protocol.ProtocolWriterResult {
|
||||
buildedCmd, _ := rule.matcher.Build(SendErrorRulePrefix, argsData...)
|
||||
|
||||
return &protocol.ProtocolWriterResult{
|
||||
Cmd: buildedCmd,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
func onWrite(writer *bufio.Writer) {
|
||||
println("Ecriture du fichier sur le réseau")
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package writers
|
||||
|
||||
import "StoreBackEnd/pkg/protocol"
|
||||
import (
|
||||
"StoreBackEnd/pkg/protocol"
|
||||
)
|
||||
|
||||
// SendOkRulePrefix Rule command prefix
|
||||
const SendOkRulePrefix = "SEND_OK"
|
||||
@@ -27,6 +29,10 @@ func (rule SendOkRule) GetCmd() string {
|
||||
}
|
||||
|
||||
// Execute the Rule with a string command.
|
||||
func (rule SendOkRule) Execute(argsData ...string) (string, bool) {
|
||||
return rule.matcher.Build(SendOkRulePrefix, argsData...)
|
||||
func (rule SendOkRule) Execute(argsData ...string) *protocol.ProtocolWriterResult {
|
||||
buildedCmd, _ := rule.matcher.Build(SendOkRulePrefix, argsData...)
|
||||
|
||||
return &protocol.ProtocolWriterResult{
|
||||
Cmd: buildedCmd,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user