Documentation ¶
Index ¶
Constants ¶
const ( // Env variables - which godaddy api to target APIProdEnv APIEnv = "prod" APIDevEnv = "dev" // Allowed API Versions - which version of the godaddy api to target APIVersion1 APIVersion = "v1" APIVersion2 = "v2" // DNS record types RecordTypeA RecordType = "A" RecordTypeAAAA = "AAAA" RecordTypeCNAME = "CNAME" RecordTypeMX = "MX" RecordTypeNS = "NS" RecordTypeSOA = "SOA" RecordTypeSRV = "SRV" RecordTypeTXT = "TXT" // Domain statuses (added "Domain" prefix to legacy constants) DomainStatusActive = "ACTIVE" DomainStatusCancelled = "CANCELLED" // Legacy Domain statuses (to support rename) StatusActive = "ACTIVE" StatusCancelled = "CANCELLED" )
const ( // MaxHTTPClientTimeout in seconds is the defalt max http client timeout // https://medium.com/@nate510/don-t-use-go-s-default-http-client-4804cb19f779 // 1 minute by default MaxHTTPClientTimeout = time.Second * 60 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v1.3.1
API knows which version to target
func NewDevelopment ¶ added in v1.3.6
NewDevelopment targets GoDaddy development API
func NewProduction ¶ added in v1.3.6
NewProduction targets GoDaddy production API
type APIEnv ¶ added in v1.3.18
type APIEnv string
APIEnv represents which endpoint to target (dev|prod)
type APIURL ¶ added in v1.3.18
type APIURL string
APIURL represents which URL to target
type APIVersion ¶ added in v1.3.18
type APIVersion string
APIVersion represents which endpoint version to target (v1|v2)
func (APIVersion) IsValid ¶ added in v1.3.20
func (v APIVersion) IsValid() bool
IsValid determines whether or not the given api version is valid
func (APIVersion) String ¶ added in v1.3.18
func (v APIVersion) String() string
type AddressMailing ¶ added in v1.3.1
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 defines a mailing address
func (*AddressMailing) FullAddress ¶ added in v1.3.8
func (am *AddressMailing) FullAddress() string
FullAddress returns the full address (Address + Address2)
type Config ¶ added in v1.3.2
type Config struct {
// contains filtered or unexported fields
}
Config holds connection options. Use `.NewConfig` to create a new config
type Contact ¶ added in v1.3.1
type Contact struct { AddressMailing AddressMailing Email string Fax string JobTitle string NameFirst string NameLast string NameMiddle string Organization string Phone string }
Contact defines the details of a contact
type Domain ¶ added in v1.3.1
type Domain interface { Records() Records GetDetails(ctx context.Context) (*DomainDetails, error) }
Domain knows how to interact with the Domains GoDaddy Gateway endpoint
type DomainAvailability ¶ added in v1.3.8
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.3.1
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 defines the details of a domain
type DomainName ¶ added in v1.3.1
type DomainName struct {
Status string
}
DomainName defines a domain name
type DomainSummary ¶ added in v1.3.8
type DomainSummary struct { CreatedAt time.Time Domain string DomainID int ExpirationProtected bool Expires time.Time ExposeWhois bool HoldRegistrar bool Locked bool NameServers []string Privacy bool RenewAuto bool Renewable bool Status string TransferAwayEligibleAt time.Time TransferProtected bool }
DomainSummary is what gets returned when listing all of your domains
type RealName ¶ added in v1.3.1
type RealName struct {
Status string `json:"status,omitempty"`
}
RealName defines the real name
type Record ¶ added in v1.3.1
type Record 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 RecordType `json:"type,omitempty"` Weight int `json:"weight,omitempty"` }
Record defines a DNS record
type RecordType ¶ added in v1.3.18
type RecordType string
RecordType represents a DNS record type
func (RecordType) IsDeletable ¶ added in v1.3.21
func (r RecordType) IsDeletable() bool
IsDeletable determines if the given record can be deleted or not
func (RecordType) IsValid ¶ added in v1.3.20
func (r RecordType) IsValid() bool
IsValid determines whether or not the given dns recorsd type is valid
func (RecordType) String ¶ added in v1.3.18
func (r RecordType) String() string
type Records ¶ added in v1.3.1
type Records interface { List(ctx context.Context) ([]Record, error) Add(ctx context.Context, rec []Record) error FindByType(ctx context.Context, t string) ([]Record, error) FindByTypeAndName(ctx context.Context, t string, n string) ([]Record, error) ReplaceByType(ctx context.Context, t string, rec []Record) error ReplaceByTypeAndName(ctx context.Context, t string, n string, rec []Record) error Update(ctx context.Context, rec []Record) error Delete(ctx context.Context, rec Record) error }
Records knows how to interact with the Records GoDaddy Gateway endpoint
type V1 ¶ added in v1.3.6
type V1 interface { Domain(name string) Domain ListDomains(ctx context.Context) ([]DomainSummary, error) CheckAvailability(ctx context.Context, name string, forTransfer bool) (DomainAvailability, error) PurchaseDomain(ctx context.Context, dom DomainDetails) error }
V1 knows how to interact with GoDaddy Gateway version 1
type V2 ¶ added in v1.3.6
type V2 interface{}
V2 knows how to interact with GoDaddy Gateway version 2
type Verifications ¶ added in v1.3.1
type Verifications struct { DomainName DomainName `json:"domainName,omitempty"` RealName RealName `json:"realName,omitempty"` }
Verifications defines who verified purchases, etc..