config: fixed app_mode

also changed like Ip to IP and Db to DB
This commit is contained in:
Luclu7 2020-12-25 02:31:28 +01:00
parent e9e84ea076
commit 8220eacb10
No known key found for this signature in database
GPG key ID: F157AA98AFB4C41B
2 changed files with 11 additions and 11 deletions

View file

@ -1,4 +1,4 @@
AppMode = "production" #Anything != production will show DEBUG messages app_mode = "production" #Anything != production will show DEBUG messages
[App] [App]
IP = "" IP = ""
@ -11,12 +11,12 @@ IP = "127.0.0.1"
Username = "sacrebleu" Username = "sacrebleu"
Password = "superSecretPassword" Password = "superSecretPassword"
Port = "3306" Port = "3306"
Db = "sacrebleudatabase" DB = "sacrebleudatabase"
Type = "mysql" #postgresql or mysql Type = "mysql" #postgresql or mysql
[Redis] [Redis]
IP = "127.0.0.1" IP = "127.0.0.1"
Port = 6379 Port = 6379
Password = "" Password = ""
Db = 0 DB = 0
Ttl = 10 #In seconds TTL = 10 #In seconds

View file

@ -3,33 +3,33 @@ package utils
//App : Struct for App (dns server) configuration in the config.ini file //App : Struct for App (dns server) configuration in the config.ini file
type App struct { type App struct {
Port int Port int
IP string IP string `ini:"IP"`
Logdir string Logdir string
Logfile bool Logfile bool
} }
//Database : Struct for SQL Database configuration in the config.ini file //Database : Struct for SQL Database configuration in the config.ini file
type Database struct { type Database struct {
IP string IP string `ini:"IP"`
Port string Port string
Username string Username string
Password string Password string
Db string Db string `ini:"DB"`
Type string Type string
} }
//Redis : Struct for Redis Database configuration in the config.ini file //Redis : Struct for Redis Database configuration in the config.ini file
type Redis struct { type Redis struct {
IP string IP string `ini:"IP"`
Port int Port int
Password string Password string
Db int Db int `ini:"DB"`
TTL int TTL int `ini:"TTL"`
} }
//Conf : Struct for the whole config.ini file when it will be parsed by go-ini //Conf : Struct for the whole config.ini file when it will be parsed by go-ini
type Conf struct { type Conf struct {
AppMode string AppMode string `ini:"app_mode"`
App App
Database Database
Redis Redis