Initial refactor of settings.

Signed-off-by: Odyssey <odyssey346@disroot.org>
This commit is contained in:
Odyssey
2022-08-14 21:06:00 +02:00
parent f0a1883db9
commit 4a6b4a82a7
13 changed files with 641 additions and 59 deletions

18
config/webhook.go Normal file
View File

@ -0,0 +1,18 @@
package config
import (
"log"
"github.com/spf13/viper"
)
func WebhookURL() string {
viper.SetConfigName("config")
viper.AddConfigPath("./data")
err := viper.ReadInConfig()
if err != nil {
log.Println("Error reading config for getting segfautils.webhook_url", err.Error())
}
result := viper.GetString("segfautils.webhook_url")
return result
}