endpoints

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DNSRecordTypes = map[string]string{
	"A":     "A",
	"AAAA":  "AAAA",
	"CNAME": "CNAME",
	"MX":    "MX",
	"NS":    "NS",
	"SOA":   "SOA",
	"SRV":   "SRV",
	"TXT":   "TXT",
}

DNSRecordTypes to be used as an enum

Functions

This section is empty.

Types

type AddressMailing

type AddressMailing struct {
	Address    string `json:"address1,omitempty"`
	Address2   string `json:"address2,omitempty"`
	City       string `json:"city,omitempty"`
	Country    string `json:"country,omitempty"`
	PostalCode string `json:"postalCode,omitempty"`
	State      string `json:"state,omitempty"`
}

AddressMailing holds contact address info

type Consent struct {
	AgreedAt      time.Time
	AgreedBy      string
	AgreementKeys []string // No idea what this is, need to dig into that
}

Consent is required when purhasing domain privacy

type Contact

type Contact struct {
	AddressMailing AddressMailing `json:"addressMailing,omitempty"`
	Email          string         `json:"email,omitempty"`
	Fax            string         `json:"fax,omitempty"`
	JobTitle       string         `json:"jobTitle,omitempty"`
	NameFirst      string         `json:"nameFirst,omitempty"`
	NameLast       string         `json:"nameLast,omitempty"`
	NameMiddle     string         `json:"nameMiddle,omitempty"`
	Organization   string         `json:"organization,omitempty"`
	Phone          string         `json:"phone,omitempty"`
}

Contact holds contact information

type Contacts

type Contacts interface {
	Validate() error
}

Contacts defines Contacts behavior

type ContactsGetter

type ContactsGetter interface {
	Contacts() Contacts
}

ContactsGetter makes embedding easier

type DNSRecord

type DNSRecord struct {
	Data     string `json:"data,omitempty"`
	Name     string `json:"name,omitempty"`
	Port     int    `json:"port,omitempty"`
	Priority int    `json:"priority,omitempty"`
	Protocol string `json:"protocol,omitempty"`
	Service  string `json:"service,omitempty"`
	TTL      int    `json:"ttl,omitempty"`
	Type     string `json:"type,omitempty"`
	Weight   int    `json:"weight,omitempty"`
}

DNSRecord is a struct that holds data about DNS records

type Domain

type Domain interface {
	ContactsGetter
	PrivacyGetter
	RecordsGetter
	GetDetails() (*DomainDetails, error)
}

Domain knows how to interact with domains you own Domain is used to target a specific domain

  • Get DNS record(s)
  • Modify DNS record(s)
  • Create DNS record(s)

etc...

type DomainAvailability added in v1.1.0

type DomainAvailability struct {
	Available  bool   `json:"available,omitempty"`
	Currency   string `json:"currency,omitempty"`
	Definitive bool   `json:"definitive,omitempty"`
	Domain     string `json:"domain,omitempty"`
	Period     int    `json:"period,omitempty"`
	Price      int    `json:"price,omitempty"`
}

DomainAvailability holds data about domain availability

type DomainDetails added in v1.0.6

type DomainDetails struct {
	AuthCode               string        `json:"authCode,omitempty"`
	ContactAdmin           Contact       `json:"contactAdmin,omitempty"`
	ContactBilling         Contact       `json:"contactBilling,omitempty"`
	ContactRegistrant      Contact       `json:"contactRegistrant,omitempty"`
	ContactTech            Contact       `json:"contactTech,omitempty"`
	CreatedAt              time.Time     `json:"createdAt,omitempty"`
	DeletedAt              time.Time     `json:"deletedAt,omitempty"`
	TransferAwayEligibleAt time.Time     `json:"transferAwayEligibleAt,omitempty"`
	Domain                 string        `json:"domain,omitempty"`
	DomainID               int           `json:"domainId,omitempty"`
	ExpirationProtected    bool          `json:"expirationProtected,omitempty"`
	Expires                time.Time     `json:"expires,omitempty"`
	ExposeWhois            bool          `json:"exposeWhois,omitempty"`
	HoldRegistrar          bool          `json:"holdRegistrar,omitempty"`
	Locked                 bool          `json:"locked,omitempty"`
	NameServers            []string      `json:"nameServers,omitempty"`
	Privacy                bool          `json:"privacy,omitempty"`
	RenewAuto              bool          `json:"renewAuto,omitempty"`
	RenewDeadline          time.Time     `json:"renewDeadline,omitempty"`
	Status                 string        `json:"status,omitempty"`
	SubAccountID           string        `json:"subaccountId,omitempty"`
	TransferProtected      bool          `json:"transferProtected,omitempty"`
	Verifications          Verifications `json:"verifications,omitempty"`
}

DomainDetails holds information about a GoDaddy domain. This is the response when you `GET` info about a domain.

type DomainGetter

type DomainGetter interface {
	Domain(domainname string) Domain
}

DomainGetter simplifies embedding

type DomainName

type DomainName struct {
	Status string `json:"status,omitempty"`
}

DomainName holds verification domain name info

type DomainPurchaseResponse

type DomainPurchaseResponse struct {
	Currency  string `json:"currency,omitempty"`
	ItemCount int    `json:"itemCount,omitempty"`
	OrderID   int    `json:"orderId,omitempty"`
	Total     int    `json:"total,omitempty"`
}

DomainPurchaseResponse is GoDaddy's response to purchasing a domain

type Domains

type Domains interface {
	CheckAvailability(domainname string) (*DomainAvailability, error)
	My() (*[]DomainDetails, error)
	Purchase(domaindetails *DomainDetails) (*DomainPurchaseResponse, error)
}

Domains knows how to interact with domains you may or may not own but want to perform tasks on.

  • Check if a domain is available for purchase
  • Purchase a domin
  • List all of the domains you own

etc...

type DomainsGetter

type DomainsGetter interface {
	Domains() Domains
}

DomainsGetter simplifies embedding

type Gateway

type Gateway interface {
	V1() V1
	V2() V2
}

Gateway knows which GoDaddy API version to target

func Connect

func Connect(c client.Interface) Gateway

Connect allows you to get a new gateway

func ConnectDevelopment

func ConnectDevelopment(apikey, apisecret string) Gateway

ConnectDevelopment is an convenience function returns a new Gateway which targets GoDaddy development API

func ConnectProduction

func ConnectProduction(apikey, apisecret string) Gateway

ConnectProduction is an convenience function returns a new Gateway which targets GoDaddy production API

type Privacy

type Privacy interface {
	Purchase(c *Consent) error
	Remove() error
}

Privacy knows how to purchase and remove privacy for a domain

type PrivacyGetter

type PrivacyGetter interface {
	Privacy() Privacy
}

PrivacyGetter makes embedding easier

type RealName

type RealName struct {
	Status string `json:"status,omitempty"`
}

RealName holds verifications real name info

type Records

type Records interface {
	Add(rec *DNSRecord) error
	AddMultiple(recordsToAdd *[]DNSRecord) error
	GetAll() (*[]DNSRecord, error)
	GetByType(recordType string) (*[]DNSRecord, error)
	GetByTypeName(recordType, recordName string) (*[]DNSRecord, error)
	SetValue(recType, recName, newValue string) error
}

Records defines `records` behavior

type RecordsGetter

type RecordsGetter interface {
	Records() Records
}

RecordsGetter simplifies embedding

type V1

type V1 interface {
	// Domain knows how to interact with domains you own
	// Domain is used to target a specific domain
	//  - Get DNS record(s)
	//  - Modify DNS record(s)
	//  - Create DNS record(s)
	// etc...
	DomainGetter

	// Domains knows how to interact with domains you may or may not
	// own but want to perform tasks on.
	//  - Check if a domain is available for purchase
	//  - Purchase a domin
	//  - List all of the domains you own
	// etc...
	DomainsGetter
}

V1 targets version 1 of the GoDaddy API

type V2

type V2 interface {
}

V2 targets version 1 of the GoDaddy API

type Verifications

type Verifications struct {
	DomainName DomainName `json:"domainName,omitempty"`
	RealName   RealName   `json:"realName,omitempty"`
}

Verifications holds verification info about a domain.

Jump to

Keyboard shortcuts

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