-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.go
65 lines (55 loc) · 1.98 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Copyright (C) 2023 Kendall Tauser
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package dns
type DNSType string
const (
A DNSType = "A"
AAAA DNSType = "AAAA"
CNAME DNSType = "CNAME"
MX DNSType = "MX"
TXT DNSType = "TXT"
URI DNSType = "URI"
NS DNSType = "NS"
)
/*
DNSProvider is an interface that can be utilized by the control plane to
configure/manage DNS records on an authoritative DNS server.
*/
type DNSProvider interface {
/*
Initialize is called by the control plane when a DNS provider is being
started up, either on control plane bootup or by user request. Similar
to the PersistenceProvider and SecretPersistenceProvider interfaces, this
method should be used by the provider to initialize any connections that
are needed for future operations, opening file descriptors for files that
could be needed in the future, etc. If there is an error with initalizing
this provider, the appropriate error should be returned and the control
plane will assume the provider is dead.
*/
Initialize() error
GetRecords() []Record
PutRecord(Record) error
DeleteRecord(Record) error
UpdateRecord(Record, Record) error
}
type Record struct {
Type DNSType `json:"type" yaml:"type"`
Host string `json:"host" yaml:"host"`
Value string `json:"value" yaml:"value"`
TTL uint `json:"ttl" yaml:"ttl"`
}