First mock of a module

This commit is contained in:
2025-01-08 00:04:21 +03:00
parent b693b38379
commit 17c27e0f59
4 changed files with 57 additions and 1 deletions

46
dnsexit_manager.go Normal file
View File

@ -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,
}
}

5
go.mod Normal file
View File

@ -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

6
go.sum Normal file
View File

@ -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=

View File

@ -1 +0,0 @@
package main