gdaddydns

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	A     dnsType = "A"
	AAAA  dnsType = "AAAA"
	CNAME dnsType = "CNAME"
	MX    dnsType = "MX"
	NS    dnsType = "NS"
	SOA   dnsType = "SOA"
	SRV   dnsType = "SRV"
	TXT   dnsType = "TXT"
	NIL   dnsType = "NIL"
)
View Source
const GO_DADDY_API_SERVER = "https://api.godaddy.com"
View Source
const GO_DADDY_DOMAIN = "/v1/domains/{domain}/records/"
View Source
const GO_DADDY_DOMAIN_TYPE = GO_DADDY_DOMAIN + "{type}/"
View Source
const GO_DADDY_DOMAIN_TYPE_NAME = GO_DADDY_DOMAIN_TYPE + "{name}/"

Variables

This section is empty.

Functions

func AddEntry

func AddEntry(entry Domain, data string, name string, dnsType dnsType, ttl int, goDaddyUrl string) error

Add an entry to the DNS

func DelEntry

func DelEntry(entry Domain, name string, dnsType dnsType, goDaddyURL string) error

Delete an Entry to the DNS

func ListEntries

func ListEntries(entry Domain, dnsType dnsType, filedump string, notable bool, goDaddyURL string) error

Get call for listing entries in the domain https://developer.godaddy.com/doc/endpoint/domains#/v1/recordGet

func PrintDomains

func PrintDomains(domains []Domain)

Print domains configured in the config file

func PrintErrorMsg

func PrintErrorMsg(msg string)

print the error message using color.Red

func PrintInfo

func PrintInfo(msg string)

print an info message using color.Blue

func SetNoColor

func SetNoColor()

disabe colors

Types

type DNSEntry

type DNSEntry struct {
	Data     string  `json:"data"`
	Name     string  `json:"name"`
	TTL      int     `json:"ttl"`
	DNSType  dnsType `json:"type"`
	Weight   int     `json:"weight"`
	Service  string  `json:"service"`
	Priority int     `json:"priority"`
	Protocol string  `json:"protocol"`
	Port     int     `json:"port"`
}

DNS entry struct returned by the godaddy api Json is the following [

{
 "data": "string",
 "name": "string",
 "port": 65535,
 "priority": 0,
 "protocol": "string",
 "service": "string",
 "ttl": 0,
 "type": "A",
 "weight": 0
}

]

type Domain

type Domain struct {
	Name       string
	Api_Key    string
	Api_Secret string
}

Domain type compose of a Name (example.com) and api key and secret

type Domains

type Domains struct {
	Domains []Domain `json:"array"`
}

Array of Domains

Jump to

Keyboard shortcuts

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