2025-04-17 11:52:47 +02:00
|
|
|
package config
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/caarlos0/env/v11"
|
|
|
|
"log"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
BaseURL string `env:"WAZUH_MANAGER_BASE_URL,required,notEmpty"`
|
2025-04-18 16:23:34 +02:00
|
|
|
User string `env:"WAZUH_MANAGER_USER,required,notEmpty"`
|
|
|
|
Passwd string `env:"WAZUH_MANAGER_PASSWD,required,notEmpty"`
|
2025-04-17 11:52:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewConfig() (*Config, error) {
|
|
|
|
cfg := &Config{}
|
|
|
|
if err := env.Parse(cfg); err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return cfg, nil
|
|
|
|
}
|