Documentation
¶
Index ¶
- Constants
- func CheckErr(err error)
- func DbgErr(err error)
- func ExtractAddressFromReverse(reverseName string) string
- func GetAllRecords(d types.Domain) []types.Record
- func GetRecord(entry types.Record) []types.Record
- func InitLogger(conf *Conf)
- func IsReverse(name string) int
- func RedisDatabase(conf *Conf) *redis.Client
- func SQLDatabase(conf *Conf) *gorm.DB
- func XfrAllowed(remoteIP string, conf *Conf) bool
- type App
- type Conf
- type DNS
- type Database
- type Redis
Constants ¶
const ( // IP4arpa is the reverse tree suffix for v4 IP addresses. IP4arpa = ".in-addr.arpa." // IP6arpa is the reverse tree suffix for v6 IP addresses. IP6arpa = ".ip6.arpa." )
Variables ¶
This section is empty.
Functions ¶
func DbgErr ¶
func DbgErr(err error)
DbgErr : If basic error, log it as classic error but don't panic and keep kalm
func ExtractAddressFromReverse ¶
ExtractAddressFromReverse turns a standard PTR reverse record name into an IP address. This works for ipv4 or ipv6.
54.119.58.176.in-addr.arpa. becomes 176.58.119.54. If the conversion fails the empty string is returned.
func GetAllRecords ¶ added in v0.0.6
GetAllRecords : Retrive all records for a domain
func GetRecord ¶
GetRecord : Check the SQL and REDIS database for a Record. A Record struct is used as input and output
func InitLogger ¶
func InitLogger(conf *Conf)
InitLogger : Init the logrus logger with rotateFileHook. Conf struct passed to get informations about the logger (debug or not)
func IsReverse ¶
IsReverse returns 0 is name is not in a reverse zone. Anything > 0 indicates name is in a reverse zone. The returned integer will be 1 for in-addr.arpa. (IPv4) and 2 for ip6.arpa. (IPv6).
func RedisDatabase ¶
func RedisDatabase(conf *Conf) *redis.Client
RedisDatabase : Initialize the Redis Database Requires a conf struct Return a *redis.Client
func SQLDatabase ¶
SQLDatabase Initialize the SQL Database Requires a conf struct
func XfrAllowed ¶ added in v0.0.6
XfrAllowed : check if the IP is allowed to perform XFR requests
Types ¶
type App ¶
type App struct { Port int IP string `ini:"IP"` Logdir string Logfile bool AllowedOrigins []string //API conf only }
App : Struct for App (dns server) configuration in the config.ini file