internal

package
v2.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDNSRecordIdx

func GetDNSRecordIdx(records []DNSRecord, record DNSRecord) (int, error)

GetDNSRecordIdx searches a given array of DNSRecords for a given DNSRecord equivalence is determined by Destination and RecortType attributes returns index of given DNSRecord in given array of DNSRecords

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 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