From bc2e3227816898a75815b8952fbf4e1c608c7514 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Tue, 22 Feb 2022 11:02:45 +0100 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20d'une=20structure=20AppConfig?= =?UTF-8?q?=20qui=20contient=20la=20configuration=20du=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/config/AppConfig.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pkg/config/AppConfig.go diff --git a/pkg/config/AppConfig.go b/pkg/config/AppConfig.go new file mode 100644 index 0000000..673bc5a --- /dev/null +++ b/pkg/config/AppConfig.go @@ -0,0 +1,28 @@ +package config + +// AppConfig Contient toute la configuration du server +type AppConfig struct { + // multicastAddress Contient l'adresse multicast du FileFrontEnd (adresse:port) + multicastAddress string + + // multicastSecond Contient le nombre de seconde entre chaque annonce + multicastSecond int + + // unicastAddress Contient l'adresse unicast auquel le FileFrontEnd se connecte (adresse:port) + unicastAddress string +} + +// MulticastAddress Accesseur pour multicastAddress +func (a *AppConfig) MulticastAddress() string { + return a.multicastAddress +} + +// MulticastSecond Accesseur pour multicastSecond +func (a *AppConfig) MulticastSecond() int { + return a.multicastSecond +} + +// UnicastAddress Accesseur pour unicastAddress +func (a *AppConfig) UnicastAddress() string { + return a.unicastAddress +}