Chargement du fichier de config fonctionnelle. Reste à utiliser ses données

This commit is contained in:
2022-02-22 13:05:33 +01:00
parent 6553ebead0
commit f6a7004137
3 changed files with 35 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"_StorBackEnd/pkg/config"
"_StorBackEnd/pkg/network"
"_StorBackEnd/pkg/protocol/managers"
"_StorBackEnd/pkg/protocol/repository"
@@ -9,6 +10,7 @@ import (
)
const (
FILE_PATH = "resources/AppConfig.json"
MULTICAST_ADDRESS = "226.66.66.1:42500"
MULTICAST_SECOND = 10 // TODO : Changer en 30 secondes
UNICAST_ADDRESS = "0.0.0.0:58000"
@@ -17,6 +19,15 @@ const (
func main() {
println("StorBackEnd started !")
// Loading App config
appConfig, err := config.Read(FILE_PATH)
if err != nil {
println("Impossible de charger la configuration du server : " + err.Error())
return
}
println("Adresse multicast : " + appConfig.MulticastAddress)
protocolRepository := repository.CreateProtocolRepository()
// Création des Writers