From 17c27e0f59544b3d0cafea3c43bacd079d320696 Mon Sep 17 00:00:00 2001 From: ZueffC Date: Wed, 8 Jan 2025 00:04:21 +0300 Subject: [PATCH] First mock of a module --- dnsexit_manager.go | 46 ++++++++++++++++++++++++++++++++++++++++++++++ go.mod | 5 +++++ go.sum | 6 ++++++ main.go | 1 - 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 dnsexit_manager.go create mode 100644 go.mod create mode 100644 go.sum delete mode 100644 main.go diff --git a/dnsexit_manager.go b/dnsexit_manager.go new file mode 100644 index 0000000..2c68eca --- /dev/null +++ b/dnsexit_manager.go @@ -0,0 +1,46 @@ +package dnsexit_manager + +import ( + "sync" + + dns "git.uoc.run.place/OxFF/dns-manager" +) + +const API_BASE = "https://api.dnsexit.com/dns/" + +type Config struct { + API_KEY string +} + +type client struct { + Lock sync.Mutex + API_KEY string +} + +func (c client) AddRecord() dns.Response { + new_response := dns.Response{} + return new_response +} + +func (c client) DellRecord() dns.Response { + new_response := dns.Response{} + return new_response +} + +func (c client) UpdateRecord() dns.Response { + new_response := dns.Response{} + return new_response +} + +func (c client) ReadRecords() (error, *[]dns.Record) { + var list_of_records []dns.Record + return nil, &list_of_records +} + + +func (conf Config) New() *client { + return &client{ + Lock: sync.Mutex{}, + API_KEY: conf.API_KEY, + } +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..1302f79 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module git.uoc.run.place/OxFF/dns-manager/dnsexit + +go 1.23.4 + +require git.uoc.run.place/OxFF/dns-manager v0.0.0-20250107205730-c4ab438a9fd5 // indirect diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..9b943c1 --- /dev/null +++ b/go.sum @@ -0,0 +1,6 @@ +git.uoc.run.place/OxFF/dns-manager v0.0.0-20250107191351-c188f3fecd73 h1:z4tzlF3wNcVBYTkkAzz16M/lCd1iEutaKDVb6/ywnNs= +git.uoc.run.place/OxFF/dns-manager v0.0.0-20250107191351-c188f3fecd73/go.mod h1:Np8QV2NBOPdRirhBYw1crbhsEekGA+ivvgAyN4MaWUw= +git.uoc.run.place/OxFF/dns-manager v0.0.0-20250107194845-f42bc60311e3 h1:5+0hjCIVoUyZOXWIIKphDnULFUFwxT8ZL/SLmsrvIGQ= +git.uoc.run.place/OxFF/dns-manager v0.0.0-20250107194845-f42bc60311e3/go.mod h1:Np8QV2NBOPdRirhBYw1crbhsEekGA+ivvgAyN4MaWUw= +git.uoc.run.place/OxFF/dns-manager v0.0.0-20250107205730-c4ab438a9fd5 h1:5H4ci0Ac/im7AKwbTxsnwuNoI4qQ8USKcFVbvf1wAX0= +git.uoc.run.place/OxFF/dns-manager v0.0.0-20250107205730-c4ab438a9fd5/go.mod h1:Np8QV2NBOPdRirhBYw1crbhsEekGA+ivvgAyN4MaWUw= diff --git a/main.go b/main.go deleted file mode 100644 index 85f0393..0000000 --- a/main.go +++ /dev/null @@ -1 +0,0 @@ -package main \ No newline at end of file