mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Ns1 provider (#63)
* add ns1 libs to vendor * Create shim and wire into tests * ns1 provider more working. * vendor correct files * comment diff functions * ns1 docs * making mx work with ns1 * ? * refactor tests to make capability blocks easier. fix up ns1
This commit is contained in:
@@ -225,6 +225,25 @@ func atou32(s string) uint32 {
|
||||
return uint32(i64)
|
||||
}
|
||||
|
||||
type Records []*RecordConfig
|
||||
|
||||
func (r Records) Grouped() map[RecordKey]Records {
|
||||
groups := map[RecordKey]Records{}
|
||||
for _, rec := range r {
|
||||
groups[rec.Key()] = append(groups[rec.Key()], rec)
|
||||
}
|
||||
return groups
|
||||
}
|
||||
|
||||
type RecordKey struct {
|
||||
Name string
|
||||
Type string
|
||||
}
|
||||
|
||||
func (r *RecordConfig) Key() RecordKey {
|
||||
return RecordKey{r.Name, r.Type}
|
||||
}
|
||||
|
||||
type Nameserver struct {
|
||||
Name string `json:"name"` // Normalized to a FQDN with NO trailing "."
|
||||
Target string `json:"target"`
|
||||
@@ -243,7 +262,7 @@ type DomainConfig struct {
|
||||
Registrar string `json:"registrar"`
|
||||
DNSProviders map[string]int `json:"dnsProviders"`
|
||||
Metadata map[string]string `json:"meta,omitempty"`
|
||||
Records []*RecordConfig `json:"records"`
|
||||
Records Records `json:"records"`
|
||||
Nameservers []*Nameserver `json:"nameservers,omitempty"`
|
||||
KeepUnknown bool `json:"keepunknown,omitempty"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user