namecheap

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MIT Imports: 13 Imported by: 9

Documentation

Overview

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

Index

Constants

View Source
const (
	EnvAPIUser = envNamespace + "API_USER"
	EnvAPIKey  = envNamespace + "API_KEY"

	EnvSandbox = envNamespace + "SANDBOX"
	EnvDebug   = envNamespace + "DEBUG"

	EnvTTL                = envNamespace + "TTL"
	EnvPropagationTimeout = envNamespace + "PROPAGATION_TIMEOUT"
	EnvPollingInterval    = envNamespace + "POLLING_INTERVAL"
	EnvHTTPTimeout        = envNamespace + "HTTP_TIMEOUT"
)

Environment variables names.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

func NewDefaultConfig() *Config

NewDefaultConfig returns a default configuration for the DNSProvider.

type DNSProvider

type DNSProvider struct {
	// contains filtered or unexported fields
}

DNSProvider implements the challenge.Provider interface.

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

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

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