dnscontrol: github.com/StackExchange/dnscontrol/providers Index | Files | Directories

package providers

import "github.com/StackExchange/dnscontrol/providers"


Package Files


func CreateDsps Uses

func CreateDsps(d *models.DNSConfig, providerConfigs map[string]map[string]string) (map[string]DNSServiceProvider, error)

func CreateRegistrars Uses

func CreateRegistrars(d *models.DNSConfig, providerConfigs map[string]map[string]string) (map[string]Registrar, error)

CreateRegistrars will load all registrars from the dns config, and create instances of the correct type using data from the provider config to load relevant keys and options.

func ProviderHasCabability Uses

func ProviderHasCabability(pType string, cap Capability) bool

func RegisterCustomRecordType Uses

func RegisterCustomRecordType(name, provider, realType string)

RegisterCustomRecordType registers a record type that is only valid for one provider. provider is the registered type of provider this is valid with name is the record type as it will appear in the js. (should be something like $PROVIDER_FOO) realType is the record type it will be replaced with after validation

func RegisterDomainServiceProviderType Uses

func RegisterDomainServiceProviderType(name string, init DspInitializer, caps ...Capability)

RegisterDomainServiceProviderType adds a dsp to the registry with the given initialization function.

func RegisterRegistrarType Uses

func RegisterRegistrarType(name string, init RegistrarInitializer)

RegisterRegistrarType adds a registrar type to the registry by providing a suitable initialization function.

type Capability Uses

type Capability uint32

Capability is a bitmasked set of "features" that a provider supports. Only use constants from this package.

const (
    // CanUseAlias indicates the provider support ALIAS records (or flattened CNAMES). Up to the provider to translate them to the appropriate record type.
    // If you add something to this list, you probably want to add it to pkg/normalize/validate.go checkProviderCapabilities() or somewhere near there.
    CanUseAlias Capability = 1 << iota
    // CanUsePTR indicates the provider can handle PTR records
    // CanUseSRV indicates the provider can handle SRV records
    // CanUseCAA indicates the provider can handle CAA records
    // CantUseNOPURGE indicates NO_PURGE is broken for this provider. To make it
    // work would require complex emulation of an incremental update mechanism,
    // so it is easier to simply mark this feature as not working for this
    // provider.

type CustomRType Uses

type CustomRType struct {
    Name     string
    Provider string
    RealType string

func GetCustomRecordType Uses

func GetCustomRecordType(rType string) *CustomRType

GetCustomRecordType returns a registered custom record type, or nil if none

type DNSServiceProvider Uses

type DNSServiceProvider interface {
    GetNameservers(domain string) ([]*models.Nameserver, error)
    GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error)

DNSServiceProvider is able to generate a set of corrections that need to be made to correct records for a domain

func CreateDNSProvider Uses

func CreateDNSProvider(dType string, config map[string]string, meta json.RawMessage) (DNSServiceProvider, error)

type DomainCreator Uses

type DomainCreator interface {
    EnsureDomainExists(domain string) error

DomainCreator should be implemented by providers that have the ability to add domains to an account. the create-domains command can be run to ensure all domains are present before running preview/push

type DspInitializer Uses

type DspInitializer func(map[string]string, json.RawMessage) (DNSServiceProvider, error)

DspInitializer is a function to create a DNS service provider. Function will be passed the unprocessed json payload from the configuration file for the given provider.

type None Uses

type None struct{}

None is a basic provider type that does absolutely nothing. Can be useful as a placeholder for third parties or unimplemented providers.

func (None) GetDomainCorrections Uses

func (n None) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Correction, error)

func (None) GetNameservers Uses

func (n None) GetNameservers(string) ([]*models.Nameserver, error)

func (None) GetRegistrarCorrections Uses

func (n None) GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error)

type Registrar Uses

type Registrar interface {
    GetRegistrarCorrections(dc *models.DomainConfig) ([]*models.Correction, error)

Registrar is an interface for a domain registrar. It can return a list of needed corrections to be applied in the future.

type RegistrarInitializer Uses

type RegistrarInitializer func(map[string]string) (Registrar, error)

RegistrarInitializer is a function to create a registrar. Function will be passed the unprocessed json payload from the configuration file for the given provider.


_allPackage all is simply a container to reference all known provider implementations for easy import into other packages
bindGenerate zonefiles.
configPackage config provides functions for reading and parsing the provider credentials json file.
namedotcomPackage namedotcom implements a registrar that uses the name.com api to set name servers.

Package providers imports 4 packages (graph) and is imported by 14 packages. Updated 2017-08-17. Refresh now. Tools for package owners.