Réception d'un fichier et sauvegarde de celui-ci terminée

This commit is contained in:
Benjamin
2022-03-08 20:37:49 +01:00
parent a987a7eb64
commit 6fa5f6c1c4
7 changed files with 53 additions and 22 deletions

View File

@@ -2,7 +2,7 @@ package repository
import (
"StoreBackEnd/pkg/protocol"
"net"
"bufio"
)
func CreateProtocolRepository() *ProtocolRepository {
@@ -36,7 +36,7 @@ func (repo ProtocolRepository) AddWriter(writer *protocol.IProtocolWriter) {
/*
ExecuteReader Permet d'exécuter un Reader et de récupérer la commande à renvoyer. La deuxième valeur de retour permet de savoir si une commande a put être exécuté
*/
func (repo ProtocolRepository) ExecuteReader(data string) (string, bool, func(r net.Conn) (string, bool)) {
func (repo ProtocolRepository) ExecuteReader(data string) (string, bool, func(reader *bufio.Reader) (string, bool)) {
for _, reader := range repo.protocolReaders {
if (*reader).Match(data) { // Exécuter si match
// Récupérer résultat à renvoyer (Donc donner ProtocolRepository aux reader ?!)