2025-01-07 22:13:51 +03:00
|
|
|
package dns_manager
|
|
|
|
|
|
|
|
type RecordType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
None RecordType = iota
|
|
|
|
A
|
|
|
|
AAAA
|
|
|
|
MX
|
|
|
|
CNAME
|
|
|
|
TXT
|
|
|
|
)
|
|
|
|
|
|
|
|
type Record struct {
|
|
|
|
Type RecordType
|
|
|
|
Host string
|
|
|
|
Content string
|
|
|
|
TTL uint16
|
|
|
|
}
|
|
|
|
|
2025-01-07 22:48:45 +03:00
|
|
|
type Actions interface {
|
|
|
|
AddRecord(Record) response
|
|
|
|
DeleteRecord() response
|
|
|
|
UpdateRecord(Record) response
|
|
|
|
ReadRecords() (error, *[]Record)
|
|
|
|
}
|
|
|
|
|
|
|
|
type Manager interface {
|
|
|
|
New() *Actions
|
|
|
|
}
|
|
|
|
|
|
|
|
type response struct {
|
2025-01-07 22:13:51 +03:00
|
|
|
error string
|
|
|
|
message string
|
|
|
|
}
|
|
|
|
|
2025-01-07 22:48:45 +03:00
|
|
|
func New(manager_config Manager) *Actions {
|
|
|
|
return manager_config.New()
|
2025-01-07 22:13:51 +03:00
|
|
|
}
|