2020-12-13 03:01:04 +00:00
|
|
|
package utils
|
|
|
|
|
2020-12-22 03:12:02 +00:00
|
|
|
//App : Struct for App (dns server) configuration in the config.ini file
|
2020-12-13 03:01:04 +00:00
|
|
|
type App struct {
|
|
|
|
Port int
|
2020-12-25 01:31:28 +00:00
|
|
|
IP string `ini:"IP"`
|
2020-12-13 03:01:04 +00:00
|
|
|
Logdir string
|
|
|
|
Logfile bool
|
|
|
|
}
|
|
|
|
|
2020-12-22 03:12:02 +00:00
|
|
|
//Database : Struct for SQL Database configuration in the config.ini file
|
2020-12-13 03:01:04 +00:00
|
|
|
type Database struct {
|
2020-12-25 02:06:20 +00:00
|
|
|
Host string `ini:"Host"`
|
2020-12-13 03:01:04 +00:00
|
|
|
Port string
|
|
|
|
Username string
|
|
|
|
Password string
|
2020-12-25 01:31:28 +00:00
|
|
|
Db string `ini:"DB"`
|
2020-12-22 18:56:54 +00:00
|
|
|
Type string
|
2020-12-13 03:01:04 +00:00
|
|
|
}
|
|
|
|
|
2020-12-22 03:12:02 +00:00
|
|
|
//Redis : Struct for Redis Database configuration in the config.ini file
|
2020-12-13 03:01:04 +00:00
|
|
|
type Redis struct {
|
2020-12-25 01:31:28 +00:00
|
|
|
IP string `ini:"IP"`
|
2020-12-13 03:01:04 +00:00
|
|
|
Port int
|
|
|
|
Password string
|
2020-12-25 01:31:28 +00:00
|
|
|
Db int `ini:"DB"`
|
|
|
|
TTL int `ini:"TTL"`
|
2020-12-13 03:01:04 +00:00
|
|
|
}
|
|
|
|
|
2021-01-03 19:17:01 +00:00
|
|
|
//DNS : Struct for XFR and NS
|
|
|
|
type DNS struct {
|
|
|
|
XfrIPs []string
|
|
|
|
Nameservers []string
|
|
|
|
}
|
|
|
|
|
2020-12-22 03:12:02 +00:00
|
|
|
//Conf : Struct for the whole config.ini file when it will be parsed by go-ini
|
2020-12-13 03:01:04 +00:00
|
|
|
type Conf struct {
|
2020-12-25 01:31:28 +00:00
|
|
|
AppMode string `ini:"app_mode"`
|
2020-12-13 03:01:04 +00:00
|
|
|
App
|
|
|
|
Database
|
|
|
|
Redis
|
2021-01-03 19:57:06 +00:00
|
|
|
DNS DNS
|
2020-12-13 03:01:04 +00:00
|
|
|
}
|