v2.7.2+incompatible Latest Latest

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

Go to latest
Published: Jul 31, 2019 License: MIT Imports: 12 Imported by: 85



Package namecheap implements a DNS provider for solving the DNS-01 challenge using namecheap DNS.



This section is empty.


This section is empty.


This section is empty.


type Config added in v1.1.0

type Config struct {
	Debug              bool
	BaseURL            string
	APIUser            string
	APIKey             string
	ClientIP           string
	PropagationTimeout time.Duration
	PollingInterval    time.Duration
	TTL                int
	HTTPClient         *http.Client

Config is used to configure the creation of the DNSProvider

func NewDefaultConfig added in v1.1.0

func NewDefaultConfig() *Config

NewDefaultConfig returns a default configuration for the DNSProvider

type DNSProvider

type DNSProvider struct {
	// contains filtered or unexported fields

DNSProvider is an implementation of the ChallengeProviderTimeout interface that uses Namecheap's tool API to manage TXT records for a domain.

func NewDNSProvider

func NewDNSProvider() (*DNSProvider, error)

NewDNSProvider returns a DNSProvider instance configured for namecheap. Credentials must be passed in the environment variables: NAMECHEAP_API_USER and NAMECHEAP_API_KEY.

func NewDNSProviderConfig added in v1.1.0

func NewDNSProviderConfig(config *Config) (*DNSProvider, error)

NewDNSProviderConfig return a DNSProvider instance configured for namecheap.

func (*DNSProvider) CleanUp

func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error

CleanUp removes a TXT record used for a previous DNS challenge.

func (*DNSProvider) Present

func (d *DNSProvider) Present(domain, token, keyAuth string) error

Present installs a TXT record for the DNS challenge.

func (*DNSProvider) Timeout

func (d *DNSProvider) Timeout() (timeout, interval time.Duration)

Timeout returns the timeout and interval to use when checking for DNS propagation. Namecheap can sometimes take a long time to complete an update, so wait up to 60 minutes for the update to propagate.

type Record added in v1.1.0

type Record struct {
	Type    string `xml:",attr"`
	Name    string `xml:",attr"`
	Address string `xml:",attr"`
	MXPref  string `xml:",attr"`
	TTL     string `xml:",attr"`

Record describes a DNS record returned by the Namecheap DNS gethosts API. Namecheap uses the term "host" to refer to all DNS records that include a host field (A, AAAA, CNAME, NS, TXT, URL).

Jump to

Keyboard shortcuts

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