client

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const HostURL string = "https://ccp.netcup.net/run/webservice/servers/endpoint.php?JSON"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthData

type AuthData struct {
	CustomerNumber string `json:"customernumber"`
	APIKey         string `json:"apikey"`
	SessionId      string `json:"apisessionid"`
}

type CCPClient

type CCPClient struct {
	UserAgent string
	// contains filtered or unexported fields
}

func NewCCPClient

func NewCCPClient(customerNumber, apiKey, apiPassword string) (*CCPClient, error)

func (*CCPClient) CreateDnsRecord

func (c *CCPClient) CreateDnsRecord(domainName string, record NewDnsRecord) (*DnsRecord, error)

func (*CCPClient) DeleteDnsRecord

func (c *CCPClient) DeleteDnsRecord(domainName string, record DnsRecord) error

func (*CCPClient) GetDnsRecordById

func (c *CCPClient) GetDnsRecordById(domainName string, id string) (*DnsRecord, error)

func (*CCPClient) GetDnsRecords

func (c *CCPClient) GetDnsRecords(domainName string) ([]DnsRecord, error)

func (*CCPClient) GetDnsZone

func (c *CCPClient) GetDnsZone(domainName string) (*DnsZone, error)

func (*CCPClient) UpdateDnsRecord

func (c *CCPClient) UpdateDnsRecord(domainName string, record DnsRecord) (*DnsRecord, error)

type CreateDnsRecordsRequest

type CreateDnsRecordsRequest struct {
	DomainInfoRequest
	DnsRecordSet NewDnsRecordSet `json:"dnsrecordset"`
}

type DnsRecord

type DnsRecord struct {
	Id           string `json:"id,omitempty"`
	Hostname     string `json:"hostname"`
	Type         string `json:"type"`
	Priority     string `json:"priority,omitempty"`
	Destination  string `json:"destination"`
	DeleteRecord bool   `json:"deleterecord,omitempty"`
	State        string `json:"state,omitempty"`
}

type DnsRecordSet

type DnsRecordSet struct {
	DnsRecords []DnsRecord `json:"dnsrecords,omitempty"`
}

type DnsRecordsResponse

type DnsRecordsResponse struct {
	ResponseBody
	ResponseData DnsRecordSet `json:"responsedata"`
}

type DnsZone

type DnsZone struct {
	Name         string `json:"domainname"`
	TTL          string `json:"ttl"`
	Serial       string `json:"serial"`
	Refresh      string `json:"refresh"`
	Retry        string `json:"retry"`
	Expire       string `json:"expire"`
	DNSSecStatus bool   `json:"dnssecstatus"`
}

type DnsZoneResponse

type DnsZoneResponse struct {
	ResponseBody
	ResponseData DnsZone `json:"responsedata"`
}

type DomainInfoRequest

type DomainInfoRequest struct {
	AuthData
	DomainName string `json:"domainname"`
}

type LoginData

type LoginData struct {
	CustomerNumber string `json:"customernumber"`
	APIKey         string `json:"apikey"`
	APIPassword    string `json:"apipassword"`
}

type LoginResponse

type LoginResponse struct {
	ResponseBody
	ResponseData SessionData `json:"responsedata"`
}

type NewDnsRecord

type NewDnsRecord struct {
	Hostname    string `json:"hostname"`
	Type        string `json:"type"`
	Priority    string `json:"priority,omitempty"`
	Destination string `json:"destination"`
}

func (NewDnsRecord) Matches

func (r NewDnsRecord) Matches(r2 DnsRecord) bool

type NewDnsRecordSet

type NewDnsRecordSet struct {
	DnsRecords []NewDnsRecord `json:"dnsrecords"`
}

type RequestBody

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

type ResponseBody

type ResponseBody struct {
	ServerRequestId string `json:"serverrequestid"`
	Action          string `json:"action"`
	Status          string `json:"status"`     // Status of the Message like "error", "started", "pending", "warning" or "success".
	StatusCode      int    `json:"statuscode"` // Status code of the Message like 2011.
	ShortMessage    string `json:"shortmessage"`
	LongMessage     string `json:"longmessage"`
}

type SessionData

type SessionData struct {
	SessionId string `json:"apisessionid"`
}

type UpdateDnsRecordsRequest

type UpdateDnsRecordsRequest struct {
	DomainInfoRequest
	DnsRecordSet DnsRecordSet `json:"dnsrecordset"`
}

Jump to

Keyboard shortcuts

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