dns-manager/dns_manager.go

40 lines
515 B
Go
Raw Normal View History

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