sacrebleu-dns/utils/structs.go

45 lines
990 B
Go
Raw Normal View History

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