This repository has been archived on 2022-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
Segfautils/config/authtoken.go
Odyssey 4a6b4a82a7 Initial refactor of settings.
Signed-off-by: Odyssey <odyssey346@disroot.org>
2022-08-14 21:06:00 +02:00

23 lines
377 B
Go

package config
import (
"log"
"github.com/spf13/viper"
)
var (
result string
)
func AuthToken() string {
viper.SetConfigName("config")
viper.AddConfigPath("./data")
err := viper.ReadInConfig()
if err != nil {
log.Println("Error reading config for getting segfautils.auth_token", err.Error())
}
result := viper.GetString("segfautils.auth_token")
return result
}