f-21: code: ajout d'un system de worker

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-04-14 21:24:13 +02:00
commit 2fbde24e89
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
8 changed files with 87 additions and 14 deletions

View file

@ -16,6 +16,10 @@ type Config struct {
Address string `mapstructure:"address"`
Port int `mapstructure:"port"`
} `mapstructure:"prometheus"`
Worker struct {
Count int `mapstructure:"count"`
BufferSize int `mapstructure:"buffer_size"`
} `mapstructure:"worker"`
}
func LoadConfig(path string) (*Config, error) {
@ -28,6 +32,8 @@ func LoadConfig(path string) (*Config, error) {
v.SetDefault("api.port", 8080)
v.SetDefault("prometheus.address", "")
v.SetDefault("prometheus.port", 9090)
v.SetDefault("worker.count", 4)
v.SetDefault("worker.buffer_size", 100)
v.ReadInConfig()