Envoie de l'annonce en multicast fonctionnelle

This commit is contained in:
2022-02-22 09:35:44 +01:00
parent e9e1dbf6d8
commit 9eb4e8204e
7 changed files with 36 additions and 14 deletions

View File

@@ -1,8 +1,6 @@
package repository
import (
"_StorBackEnd/pkg/protocol"
)
import "_StorBackEnd/pkg/protocol"
func CreateProtocolRepository() *ProtocolRepository {
return &ProtocolRepository{
@@ -48,6 +46,19 @@ func (repo ProtocolRepository) ExecuteReader(data string) (string, bool) {
return "", false
}
/*
ExecuteReader Permet d'exécuter un Wrier et de récupérer la commande construite avec nos argument et un indicateur de réussite.
*/
func (repo ProtocolRepository) ExecuteWriter(ruleName string, data ...string) (string, bool) {
protWriter, has := repo.protocolWriters[ruleName]
if has {
println("OHOH")
return (*protWriter).Execute(data...)
} else {
return "", false
}
}
// containsReader Permet de vérifier si le reader est déjà contenu
func (repo ProtocolRepository) containsReader(cmd string) bool {
_, has := repo.protocolReaders[cmd]