config

package
v0.0.0-...-8df2434 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SpotifyClientID is the name of the Viper config key for the Spotify API client ID
	SpotifyClientID = "spotify_client_id"
	// SpotifyClientSecret is the name of the Viper config key for the Spotify API client secret
	SpotifyClientSecret = "spotify_client_secret"
	// ServerURL is the name of the Viper config key for the Server's URL
	ServerURL = "server_url"
)

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(level, logFile string, useSTDOUT bool) error

Types

type ConfigFile

type ConfigFile struct {
	Server     ServerConfig  `mapstructure:"server"`
	Spotify    SpotifyConfig `mapstructure:"spotify"`
	WifiQRCode WifiQRConfig  `mapstructure:"wifi_qrcode"`
	Logging    LogConfig     `mapstrucutre:"logging"`
}

func InitConfig

func InitConfig() (cfg ConfigFile, err error)

InitConfig will initialize the viper configuration

type LogConfig

type LogConfig struct {
	Level     string `mapstructure:"level"`
	LogFile   string `mapstructure:"log_file"`
	UseSTDOUT bool   `mapstructure:"use_stdout"`
}

type ServerConfig

type ServerConfig struct {
	Port        int
	Host        string
	ExternalURL string
}

type SpotifyConfig

type SpotifyConfig struct {
	ClientID     string `mapstructure:"clientID"`
	ClientSecret string `mapstructure:"clientSecret"`
}

type WifiQRConfig

type WifiQRConfig struct {
	SSID     string `mapstructure:"ssid"`
	AuthType string `mapstructure:"authType"`
	Password string `mapstructure:"password"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL