From c188f3fecd73f9098940289c1b192f66eac7e0c0 Mon Sep 17 00:00:00 2001 From: ZueffC Date: Tue, 7 Jan 2025 22:13:51 +0300 Subject: [PATCH] Added first prototype of library --- dns_manager.go | 31 +++++++++++++++++++++++++++++++ go.mod | 3 +++ 2 files changed, 34 insertions(+) create mode 100644 dns_manager.go create mode 100644 go.mod diff --git a/dns_manager.go b/dns_manager.go new file mode 100644 index 0000000..1fdf978 --- /dev/null +++ b/dns_manager.go @@ -0,0 +1,31 @@ +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 +} + +type Response struct { + error string + message string +} + +type Actions interface { + AddRecord(Record) Response + DeleteRecord() Response + UpdateRecord(Record) Response + ReadRecords() (error, *[]Record) +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..77b4fbd --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.uoc.run.place/OxFF/dns-manager + +go 1.23.4