@@ -33,8 +33,10 @@ type YamlConfig struct {
3333
3434// YamlServerConfig mapping to Server part
3535type YamlServerConfig struct {
36- Host * string `yaml:"host"`
37- Port * int `yaml:"port"`
36+ Host * string `yaml:"host"`
37+ Port * int `yaml:"port"`
38+ AuthUser * string `yaml:"auth_user"`
39+ AuthPW * string `yaml:"auth_pw"`
3840}
3941
4042// YamlProbeConfig mapping to Probes part
@@ -55,8 +57,10 @@ type YamlProbeConfig []struct {
5557
5658type internalConfig struct {
5759 server struct {
58- host string
59- port int
60+ host string
61+ port int
62+ authUser string
63+ authPW string
6064 }
6165
6266 probes map [string ]probeType
@@ -160,6 +164,22 @@ func configServer(serverConfig YamlServerConfig, fileName string) {
160164
161165 config .server .port = * serverConfig .Port
162166 }
167+
168+ if serverConfig .AuthUser != nil {
169+ if config .server .authUser != "" {
170+ log .Fatalf ("Config failure 'authUser' is already set (%s)" , fileName )
171+ }
172+
173+ config .server .authUser = * serverConfig .AuthUser
174+ }
175+
176+ if serverConfig .AuthPW != nil {
177+ if config .server .authPW != "" {
178+ log .Fatalf ("Config failure 'authPW' is already set (%s)" , fileName )
179+ }
180+
181+ config .server .authPW = * serverConfig .AuthPW
182+ }
163183}
164184
165185func configProbes (probesConfig YamlProbeConfig , fileName string ) {
0 commit comments