2018-02-02 00:45:53 +08:00
|
|
|
package models
|
|
|
|
|
2018-02-16 01:02:50 +08:00
|
|
|
// DNSProvider is an interface for DNS Provider plug-ins.
|
2018-02-02 00:45:53 +08:00
|
|
|
type DNSProvider interface {
|
|
|
|
GetNameservers(domain string) ([]*Nameserver, error)
|
|
|
|
GetDomainCorrections(dc *DomainConfig) ([]*Correction, error)
|
|
|
|
}
|
|
|
|
|
2018-02-16 01:02:50 +08:00
|
|
|
// Registrar is an interface for Registrar plug-ins.
|
2018-02-02 00:45:53 +08:00
|
|
|
type Registrar interface {
|
|
|
|
GetRegistrarCorrections(dc *DomainConfig) ([]*Correction, error)
|
|
|
|
}
|
|
|
|
|
2018-02-16 01:02:50 +08:00
|
|
|
// ProviderBase describes providers.
|
2018-02-02 00:45:53 +08:00
|
|
|
type ProviderBase struct {
|
|
|
|
Name string
|
|
|
|
IsDefault bool
|
|
|
|
ProviderType string
|
|
|
|
}
|
|
|
|
|
2018-02-16 01:02:50 +08:00
|
|
|
// RegistrarInstance is a single registrar.
|
2018-02-02 00:45:53 +08:00
|
|
|
type RegistrarInstance struct {
|
|
|
|
ProviderBase
|
|
|
|
Driver Registrar
|
|
|
|
}
|
|
|
|
|
2018-02-16 01:02:50 +08:00
|
|
|
// DNSProviderInstance is a single DNS provider.
|
2018-02-02 00:45:53 +08:00
|
|
|
type DNSProviderInstance struct {
|
|
|
|
ProviderBase
|
|
|
|
Driver DNSProvider
|
|
|
|
NumberOfNameservers int
|
|
|
|
}
|