hostingde

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2019 License: MIT Imports: 10 Imported by: 65

Documentation

Overview

Package hostingde implements a DNS provider for solving the DNS-01 challenge using hosting.de.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey             string
	ZoneName           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 is an implementation of the acme.ChallengeProvider interface

func NewDNSProvider

func NewDNSProvider() (*DNSProvider, error)

NewDNSProvider returns a DNSProvider instance configured for hosting.de. Credentials must be passed in the environment variables: HOSTINGDE_ZONE_NAME and HOSTINGDE_API_KEY

func NewDNSProviderConfig

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

NewDNSProviderConfig return a DNSProvider instance configured for hosting.de.

func (*DNSProvider) CleanUp

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

CleanUp removes the TXT record matching the specified parameters

func (*DNSProvider) Present

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

Present creates a TXT record to fulfill the dns-01 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. Adjusting here to cope with spikes in propagation times.

type RecordsAddRequest

type RecordsAddRequest struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Content string `json:"content"`
	TTL     int    `json:"ttl"`
}

RecordsAddRequest represents a DNS record to add

type RecordsDeleteRequest

type RecordsDeleteRequest struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Content string `json:"content"`
	ID      string `json:"id"`
}

RecordsDeleteRequest represents a DNS record to remove

type ZoneConfigObject

type ZoneConfigObject struct {
	AccountID      string `json:"accountId"`
	EmailAddress   string `json:"emailAddress"`
	ID             string `json:"id"`
	LastChangeDate string `json:"lastChangeDate"`
	MasterIP       string `json:"masterIp"`
	Name           string `json:"name"`
	NameUnicode    string `json:"nameUnicode"`
	SOAValues      struct {
		Expire      int    `json:"expire"`
		NegativeTTL int    `json:"negativeTtl"`
		Refresh     int    `json:"refresh"`
		Retry       int    `json:"retry"`
		Serial      string `json:"serial"`
		TTL         int    `json:"ttl"`
	} `json:"soaValues"`
	Status                string   `json:"status"`
	TemplateValues        string   `json:"templateValues"`
	Type                  string   `json:"type"`
	ZoneTransferWhitelist []string `json:"zoneTransferWhitelist"`
}

ZoneConfigObject represents the ZoneConfig-section of a hosting.de API response.

type ZoneConfigSelector

type ZoneConfigSelector struct {
	Name string `json:"name"`
}

ZoneConfigSelector represents a "minimal" ZoneConfig object used in hosting.de API requests

type ZoneUpdateError

type ZoneUpdateError struct {
	Code          int      `json:"code"`
	ContextObject string   `json:"contextObject"`
	ContextPath   string   `json:"contextPath"`
	Details       []string `json:"details"`
	Text          string   `json:"text"`
	Value         string   `json:"value"`
}

ZoneUpdateError represents an error in a ZoneUpdateResponse

type ZoneUpdateMetadata

type ZoneUpdateMetadata struct {
	ClientTransactionID string `json:"clientTransactionId"`
	ServerTransactionID string `json:"serverTransactionId"`
}

ZoneUpdateMetadata represents the metadata in a ZoneUpdateResponse

type ZoneUpdateRequest

type ZoneUpdateRequest struct {
	AuthToken          string `json:"authToken"`
	ZoneConfigSelector `json:"zoneConfig"`
	RecordsToAdd       []RecordsAddRequest    `json:"recordsToAdd"`
	RecordsToDelete    []RecordsDeleteRequest `json:"recordsToDelete"`
}

ZoneUpdateRequest represents a hosting.de API ZoneUpdate request

type ZoneUpdateResponse

type ZoneUpdateResponse struct {
	Errors   []ZoneUpdateError  `json:"errors"`
	Metadata ZoneUpdateMetadata `json:"metadata"`
	Warnings []string           `json:"warnings"`
	Status   string             `json:"status"`
	Response struct {
		Records []struct {
			Content          string `json:"content"`
			Type             string `json:"type"`
			ID               string `json:"id"`
			Name             string `json:"name"`
			LastChangeDate   string `json:"lastChangeDate"`
			Priority         int    `json:"priority"`
			RecordTemplateID string `json:"recordTemplateId"`
			ZoneConfigID     string `json:"zoneConfigId"`
			TTL              int    `json:"ttl"`
		} `json:"records"`
		ZoneConfig ZoneConfigObject `json:"zoneConfig"`
	} `json:"response"`
}

ZoneUpdateResponse represents a response from hosting.de API

Jump to

Keyboard shortcuts

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