very basic thoughts on module and file structure

basic configuration
basic logger
This commit is contained in:
Jakob Schrettenbrunner
2017-06-19 00:01:44 +02:00
parent 2568d9dd1a
commit 326fdcae6e
8 changed files with 156 additions and 0 deletions

32
config/config.go Normal file
View 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() {
}