dns-manager/dns_manager.go

40 lines
526 B
Go
Raw Normal View History

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 23:57:30 +03:00
type actions interface {
AddRecord(Record) Response
DeleteRecord() Response
UpdateRecord(Record) Response
2025-01-07 22:48:45 +03:00
ReadRecords() (error, *[]Record)
}
2025-01-07 23:57:30 +03:00
type manager interface {
New() *actions
2025-01-07 22:48:45 +03:00
}
2025-01-07 23:57:30 +03:00
type Response struct {
2025-01-07 22:13:51 +03:00
error string
message string
}
2025-01-07 23:57:30 +03:00
func New(manager_config manager) *actions {
2025-01-07 22:48:45 +03:00
return manager_config.New()
2025-01-07 22:13:51 +03:00
}