2020-12-13 04:01:04 +01:00
package utils
2020-12-22 04:12:02 +01:00
//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
2020-12-22 04:12:02 +01:00
IP string
2020-12-13 04:01:04 +01:00
Logdir string
Logfile bool
}
2020-12-22 04:12:02 +01:00
//Database : Struct for SQL Database configuration in the config.ini file
2020-12-13 04:01:04 +01:00
type Database struct {
2020-12-22 04:12:02 +01:00
IP string
2020-12-13 04:01:04 +01:00
Port string
Username string
Password string
Db string
2020-12-22 19:56:54 +01:00
Type string
2020-12-13 04:01:04 +01:00
}
2020-12-22 04:12:02 +01:00
//Redis : Struct for Redis Database configuration in the config.ini file
2020-12-13 04:01:04 +01:00
type Redis struct {
2020-12-22 04:12:02 +01:00
IP string
2020-12-13 04:01:04 +01:00
Port int
Password string
Db int
2020-12-22 04:12:02 +01:00
TTL int
2020-12-13 04:01:04 +01:00
}
2020-12-22 04:12:02 +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 {
2020-12-22 04:12:02 +01:00
AppMode string
2020-12-13 04:01:04 +01:00
App
Database
Redis
}
2020-12-22 04:12:02 +01:00
//Record : Struct for a domain record
2020-12-14 23:20:24 +01:00
//Defined by it's ID, DomainID (parent domain), Fqdn (or name), Content (value of the record), Type (as Qtype/int), TTL (used only for the DNS response and not the Redis TTL)
2020-12-13 04:01:04 +01:00
type Record struct {
2020-12-23 01:09:10 +01:00
ID uint ` gorm:"primaryKey" `
2020-12-22 04:12:02 +01:00
DomainID int
2020-12-13 04:01:04 +01:00
Fqdn string
Content string
Type int
2020-12-23 01:09:10 +01:00
Qtype uint16 ` gorm:"-" `
2020-12-13 04:01:04 +01:00
TTL int
}