sacrebleu-dns/utils/structs.go

57 lines
1.1 KiB
Go
Raw Normal View History

2020-12-13 04:01:04 +01:00
package utils
2020-12-14 23:20:24 +01:00
//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
Logdir string
Logfile bool
}
2020-12-14 23:20:24 +01:00
//Struct for SQL Database configuration in the config.ini file
2020-12-13 04:01:04 +01:00
type Database struct {
Ip string
Port string
Username string
Password string
Db string
}
2020-12-14 23:20:24 +01:00
//Struct for Redis Database configuration in the config.ini file
2020-12-13 04:01:04 +01:00
type Redis struct {
Ip string
Port int
Password string
Db int
Ttl int
}
2020-12-14 23:20:24 +01:00
//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 {
App_mode string
App
Database
Redis
}
2020-12-14 23:20:24 +01:00
//Struct for a Domain (not used currently).
2020-12-13 04:01:04 +01:00
type Domain struct {
ID int `json:"id"`
FriendlyName string
Fqdn string
OwnerId int
LastEdit string
}
2020-12-14 23:20:24 +01:00
//Struct for a domain record
//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 {
Id int
DomainId int
Fqdn string
Content string
Type int
Qtype uint16
TTL int
}