41 lines
988 B
Go
41 lines
988 B
Go
package setup
|
|
|
|
/* ---------------------------------------------------------------- *
|
|
* IMPORTS
|
|
* ---------------------------------------------------------------- */
|
|
|
|
import (
|
|
"gopkg.in/yaml.v3"
|
|
|
|
"ads/internal/types"
|
|
)
|
|
|
|
/* ---------------------------------------------------------------- *
|
|
* GLOBAL CONSTANTS
|
|
* ---------------------------------------------------------------- */
|
|
|
|
var AppConfig = types.AppConfig{}
|
|
|
|
/* ---------------------------------------------------------------- *
|
|
* METHODS
|
|
* ---------------------------------------------------------------- */
|
|
|
|
// Extrahiert Inhalte einer YAML Config und parset dies als Struktur
|
|
func AppConfigInitialise() error {
|
|
contents := AppConfigYaml()
|
|
err := yaml.Unmarshal([]byte(contents), &AppConfig)
|
|
return err
|
|
}
|
|
|
|
func AppConfigFancyMode() bool {
|
|
return AppConfig.Options.Display
|
|
}
|
|
|
|
func AppConfigShowMetrics() bool {
|
|
return AppConfig.Options.Metrics
|
|
}
|
|
|
|
func AppConfigPerformChecks() bool {
|
|
return AppConfig.Options.Checks
|
|
}
|