diff --git a/extra/config.ini.example b/extra/config.ini.example index 4054330..47c7be1 100644 --- a/extra/config.ini.example +++ b/extra/config.ini.example @@ -1,4 +1,4 @@ -AppMode = "production" #Anything != production will show DEBUG messages +app_mode = "production" #Anything != production will show DEBUG messages [App] IP = "" @@ -11,12 +11,12 @@ IP = "127.0.0.1" Username = "sacrebleu" Password = "superSecretPassword" Port = "3306" -Db = "sacrebleudatabase" +DB = "sacrebleudatabase" Type = "mysql" #postgresql or mysql [Redis] IP = "127.0.0.1" Port = 6379 Password = "" -Db = 0 -Ttl = 10 #In seconds +DB = 0 +TTL = 10 #In seconds diff --git a/utils/structs.go b/utils/structs.go index 7ad8baa..d7b0a54 100644 --- a/utils/structs.go +++ b/utils/structs.go @@ -3,33 +3,33 @@ package utils //App : Struct for App (dns server) configuration in the config.ini file type App struct { Port int - IP string + IP string `ini:"IP"` Logdir string Logfile bool } //Database : Struct for SQL Database configuration in the config.ini file type Database struct { - IP string + IP string `ini:"IP"` Port string Username string Password string - Db string + Db string `ini:"DB"` Type string } //Redis : Struct for Redis Database configuration in the config.ini file type Redis struct { - IP string + IP string `ini:"IP"` Port int Password string - Db int - TTL int + Db int `ini:"DB"` + TTL int `ini:"TTL"` } //Conf : Struct for the whole config.ini file when it will be parsed by go-ini type Conf struct { - AppMode string + AppMode string `ini:"app_mode"` App Database Redis