providers

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDsps

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

func CreateRegistrars

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 RegisterDomainServiceProviderType

func RegisterDomainServiceProviderType(name string, init DspInitializer)

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

func RegisterRegistrarType

func RegisterRegistrarType(name string, init RegistrarInitializer)

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

Types

type DNSServiceProvider

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

type DomainCreator

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

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

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

type None

type None struct{}

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

func (None) GetDomainCorrections

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

func (None) GetNameservers

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

func (None) GetRegistrarCorrections

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

type Registrar

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

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.

Directories

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL