internal

package
v4.18.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://api.godaddy.com"

DefaultBaseURL represents the API endpoint to call.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code    string  `json:"code,omitempty"`
	Fields  []Field `json:"fields,omitempty"`
	Message string  `json:"message,omitempty"`
}

func (APIError) Error

func (a APIError) Error() string

type Client

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

func NewClient

func NewClient(apiKey string, apiSecret string) *Client

func (*Client) DeleteTxtRecords

func (c *Client) DeleteTxtRecords(ctx context.Context, domainZone, recordName string) error

DeleteTxtRecords deletes all DNS Records for the specified Domain with the specified Type and Name. https://developer.godaddy.com/doc/endpoint/domains#/v1/recordDeleteTypeName

func (*Client) GetRecords

func (c *Client) GetRecords(ctx context.Context, domainZone, rType, recordName string) ([]DNSRecord, error)

GetRecords retrieves DNS Records for the specified Domain. https://developer.godaddy.com/doc/endpoint/domains#/v1/recordGet

func (*Client) UpdateTxtRecords

func (c *Client) UpdateTxtRecords(ctx context.Context, records []DNSRecord, domainZone, recordName string) error

UpdateTxtRecords replaces all DNS Records for the specified Domain with the specified Type. https://developer.godaddy.com/doc/endpoint/domains#/v1/recordReplaceType

type DNSRecord

type DNSRecord struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
	Data string `json:"data"`
	TTL  int    `json:"ttl,omitempty"`

	Priority int    `json:"priority,omitempty"`
	Port     int    `json:"port,omitempty"`
	Protocol string `json:"protocol,omitempty"`
	Service  string `json:"service,omitempty"`
	Weight   int    `json:"weight,omitempty"`
}

DNSRecord a DNS record.

type Field

type Field struct {
	Code        string `json:"code,omitempty"`
	Message     string `json:"message,omitempty"`
	Path        string `json:"path,omitempty"`
	PathRelated string `json:"pathRelated,omitempty"`
}

func (Field) String

func (f Field) String() string

Jump to

Keyboard shortcuts

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