very basic thoughts on module and file structure
basic configuration basic logger
This commit is contained in:
32
config/config.go
Normal file
32
config/config.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
// Config contains the configuration of the Pterodactyl Daemon
|
||||
type Config struct {
|
||||
|
||||
// Log contains configuration related to logging
|
||||
Log struct {
|
||||
|
||||
// DeleteAfterDays is the time in days after which logfiles are deleted
|
||||
// If set to <= 0 logs are kept forever
|
||||
DeleteAfterDays int
|
||||
} `json:"log"`
|
||||
}
|
||||
|
||||
func LoadConfiguration() error {
|
||||
viper.SetConfigName("config")
|
||||
viper.AddConfigPath(".")
|
||||
// Find and read the config file
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func setDefaults() {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user