github.com/teknogeek/dnscontrol/v2@v2.10.1-0.20200227202244-ae299b55ba42/models/provider.go (about)

     1  package models
     2  
     3  // DNSProvider is an interface for DNS Provider plug-ins.
     4  type DNSProvider interface {
     5  	GetNameservers(domain string) ([]*Nameserver, error)
     6  	GetDomainCorrections(dc *DomainConfig) ([]*Correction, error)
     7  	GetZoneRecords(domain string) (Records, error)
     8  }
     9  
    10  // Registrar is an interface for Registrar plug-ins.
    11  type Registrar interface {
    12  	GetRegistrarCorrections(dc *DomainConfig) ([]*Correction, error)
    13  }
    14  
    15  // ProviderBase describes providers.
    16  type ProviderBase struct {
    17  	Name         string
    18  	IsDefault    bool
    19  	ProviderType string
    20  }
    21  
    22  // RegistrarInstance is a single registrar.
    23  type RegistrarInstance struct {
    24  	ProviderBase
    25  	Driver Registrar
    26  }
    27  
    28  // DNSProviderInstance is a single DNS provider.
    29  type DNSProviderInstance struct {
    30  	ProviderBase
    31  	Driver              DNSProvider
    32  	NumberOfNameservers int
    33  }