netcup

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package netcup implements a DNS Provider for solving the DNS-01 challenge using the netcup DNS API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	BaseURL    string
	// contains filtered or unexported fields
}

Client netcup DNS client

func NewClient

func NewClient(customerNumber string, apiKey string, apiPassword string) (*Client, error)

NewClient creates a netcup DNS client

func (*Client) GetDNSRecords

func (c *Client) GetDNSRecords(hostname, apiSessionID string) ([]DNSRecord, error)

GetDNSRecords retrieves all dns records of an DNS-Zone as specified by the netcup WSDL returns an array of DNSRecords https://ccp.netcup.net/run/webservice/servers/endpoint.php

func (*Client) Login

func (c *Client) Login() (string, error)

Login performs the login as specified by the netcup WSDL returns sessionID needed to perform remaining actions https://ccp.netcup.net/run/webservice/servers/endpoint.php

func (*Client) Logout

func (c *Client) Logout(sessionID string) error

Logout performs the logout with the supplied sessionID as specified by the netcup WSDL https://ccp.netcup.net/run/webservice/servers/endpoint.php

func (*Client) UpdateDNSRecord

func (c *Client) UpdateDNSRecord(sessionID, domainName string, records []DNSRecord) error

UpdateDNSRecord performs an update of the DNSRecords as specified by the netcup WSDL https://ccp.netcup.net/run/webservice/servers/endpoint.php

type Config

type Config struct {
	Key                string
	Password           string
	Customer           string
	TTL                int
	PropagationTimeout time.Duration
	PollingInterval    time.Duration
	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 netcup. Credentials must be passed in the environment variables: NETCUP_CUSTOMER_NUMBER, NETCUP_API_KEY, NETCUP_API_PASSWORD

func NewDNSProviderConfig

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

NewDNSProviderConfig return a DNSProvider instance configured for netcup.

func NewDNSProviderCredentials

func NewDNSProviderCredentials(customer, key, password string) (*DNSProvider, error)

NewDNSProviderCredentials uses the supplied credentials to return a DNSProvider instance configured for netcup. Deprecated

func (*DNSProvider) CleanUp

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

CleanUp removes the TXT record matching the specified parameters

func (*DNSProvider) Present

func (d *DNSProvider) Present(domainName, 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 DNSRecord

type DNSRecord struct {
	ID           int    `json:"id,string,omitempty"`
	Hostname     string `json:"hostname"`
	RecordType   string `json:"type"`
	Priority     string `json:"priority,omitempty"`
	Destination  string `json:"destination"`
	DeleteRecord bool   `json:"deleterecord,omitempty"`
	State        string `json:"state,omitempty"`
	TTL          int    `json:"ttl,omitempty"`
}

DNSRecord as specified in netcup WSDL https://ccp.netcup.net/run/webservice/servers/endpoint.php#Dnsrecord

type DNSRecordSet

type DNSRecordSet struct {
	DNSRecords []DNSRecord `json:"dnsrecords"`
}

DNSRecordSet as specified in netcup WSDL needed in UpdateDNSRecordsRequest https://ccp.netcup.net/run/webservice/servers/endpoint.php#Dnsrecordset

type InfoDNSRecordsRequest

type InfoDNSRecordsRequest struct {
	DomainName      string `json:"domainname"`
	CustomerNumber  string `json:"customernumber"`
	APIKey          string `json:"apikey"`
	APISessionID    string `json:"apisessionid"`
	ClientRequestID string `json:"clientrequestid,omitempty"`
}

InfoDNSRecordsRequest as specified in netcup WSDL https://ccp.netcup.net/run/webservice/servers/endpoint.php#infoDnsRecords

type InfoDNSRecordsResponse

type InfoDNSRecordsResponse struct {
	APISessionID string      `json:"apisessionid"`
	DNSRecords   []DNSRecord `json:"dnsrecords,omitempty"`
}

InfoDNSRecordsResponse response to infoDnsRecords action.

type LoginRequest

type LoginRequest struct {
	CustomerNumber  string `json:"customernumber"`
	APIKey          string `json:"apikey"`
	APIPassword     string `json:"apipassword"`
	ClientRequestID string `json:"clientrequestid,omitempty"`
}

LoginRequest as specified in netcup WSDL https://ccp.netcup.net/run/webservice/servers/endpoint.php#login

type LoginResponse

type LoginResponse struct {
	APISessionID string `json:"apisessionid"`
}

LoginResponse response to login action.

type LogoutRequest

type LogoutRequest struct {
	CustomerNumber  string `json:"customernumber"`
	APIKey          string `json:"apikey"`
	APISessionID    string `json:"apisessionid"`
	ClientRequestID string `json:"clientrequestid,omitempty"`
}

LogoutRequest as specified in netcup WSDL https://ccp.netcup.net/run/webservice/servers/endpoint.php#logout

type Request

type Request struct {
	Action string      `json:"action"`
	Param  interface{} `json:"param"`
}

Request wrapper as specified in netcup wiki needed for every request to netcup API around *Msg https://www.netcup-wiki.de/wiki/CCP_API#Anmerkungen_zu_JSON-Requests

type ResponseMsg

type ResponseMsg struct {
	ServerRequestID string          `json:"serverrequestid"`
	ClientRequestID string          `json:"clientrequestid,omitempty"`
	Action          string          `json:"action"`
	Status          string          `json:"status"`
	StatusCode      int             `json:"statuscode"`
	ShortMessage    string          `json:"shortmessage"`
	LongMessage     string          `json:"longmessage"`
	ResponseData    json.RawMessage `json:"responsedata,omitempty"`
}

ResponseMsg as specified in netcup WSDL https://ccp.netcup.net/run/webservice/servers/endpoint.php#Responsemessage

func (*ResponseMsg) Error

func (r *ResponseMsg) Error() string

type UpdateDNSRecordsRequest

type UpdateDNSRecordsRequest struct {
	DomainName      string       `json:"domainname"`
	CustomerNumber  string       `json:"customernumber"`
	APIKey          string       `json:"apikey"`
	APISessionID    string       `json:"apisessionid"`
	ClientRequestID string       `json:"clientrequestid,omitempty"`
	DNSRecordSet    DNSRecordSet `json:"dnsrecordset"`
}

UpdateDNSRecordsRequest as specified in netcup WSDL https://ccp.netcup.net/run/webservice/servers/endpoint.php#updateDnsRecords

Jump to

Keyboard shortcuts

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