dynuclient

package
v0.0.0-...-20916ca Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIException

type APIException struct {
	StatusCode int
	Type       string
	Message    string
}

APIException ...

type DNSRecord

type DNSRecord struct {
	NodeName   string `json:"nodeName"`
	RecordType string `json:"recordType"`
	TextData   string `json:"textData"`
	TTL        string `json:"ttl"`
	DomainID   int    `json:"domainId,omitempty"`
	State      bool   `json:"state,omitempty"`
}

DNSRecord ...

type DNSRecords

type DNSRecords struct {
	StatusCode int           `json:"statusCode,omitempty"`
	DNSRecords []DNSResponse `json:"dnsRecords,omitempty"`
}

DNSRecords ...

type DNSResponse

type DNSResponse struct {
	StatusCode int    `json:"statusCode"`
	ID         int    `json:"id"`
	DomainID   int    `json:"domainId"`
	DomainName string `json:"domainName"`
	NodeName   string `json:"nodeName"`
	Hostname   string `json:"hostname"`
	RecordType string `json:"recordType"`
	TTL        int16  `json:"ttl"`
	State      bool   `json:"state"`
	Content    string `json:"content"`
	UpdatedOn  string `json:"updatedOn"`
	TextData   string `json:"textData"`
}

DNSResponse ...

type Domain

type Domain struct {
	StatusCode int          `json:"statusCode"`
	ID         int          `json:"id"`
	Hostname   string       `json:"hostname"`
	DomainName string       `json:"domainName"`
	Node       string       `json:"node"`
	Exception  APIException `json:"exception"`
}

Domain - The Root Domain

type DynuClient

type DynuClient struct {
	HTTPClient *http.Client
	HostName   string
	UserAgent  string
	APIKey     string
}

DynuClient ... options for DynuClient

func (*DynuClient) CreateDNSRecord

func (c *DynuClient) CreateDNSRecord(record DNSRecord) (int, error)

CreateDNSRecord ... Create a DNS Record and return it's ID

POST https://api.dynu.com/v2/dns/{DNSID}/record

func (*DynuClient) GetDNSRecord

func (c *DynuClient) GetDNSRecord(domainID int, nodeName, textData string) (*DNSResponse, error)

GetDNSRecord ...

func (*DynuClient) GetDomainID

func (c *DynuClient) GetDomainID() (int, error)

GetDomainID ...

func (*DynuClient) RemoveDNSRecord

func (c *DynuClient) RemoveDNSRecord(nodeName, textData string) error

RemoveDNSRecord ... Removes a DNS record based on dnsRecordID

DELETE https://api.dynu.com/v2/dns/{DNSID}/record/{DNSRecordID}

type DynuCreds

type DynuCreds struct {
	APIKey string
}

DynuCreds - Details required to access API

Jump to

Keyboard shortcuts

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