Documentation ¶
Index ¶
Constants ¶
const ( // APIProdEnv targets the production API APIProdEnv = "prod" // APIDevEnv targets the development API APIDevEnv = "dev" // APIVersion1 specifies version 1 APIVersion1 = "v1" // APIVersion2 specifies version 2 APIVersion2 = "v2" // RecordTypeA defines A record RecordTypeA = "A" // RecordTypeAAAA defines AAAA record RecordTypeAAAA = "AAAA" // RecordTypeCNAME defines CNAME record RecordTypeCNAME = "CNAME" // RecordTypeMX defines MX record RecordTypeMX = "MX" // RecordTypeNS defines NS record RecordTypeNS = "NS" // RecordTypeSOA defines SOA record RecordTypeSOA = "SOA" // RecordTypeSRV defines SRV record RecordTypeSRV = "SRV" // RecordTypeTXT defines TXT record RecordTypeTXT = "TXT" )
Variables ¶
var ( // ErrorWrongStatusCode is the error generated when an incorrect http status code is received ErrorWrongStatusCode = fmt.Errorf("ErrorWrongStatusCode") // ErrorWrongAPIVersion is the error you get when an incorrect API version is privided within // a config ErrorWrongAPIVersion = fmt.Errorf("ErrorWrongAPIVersion") // ErrorWrongAPIEnv is the error you get when an incorrect API env (production or development) // is privided within a config ErrorWrongAPIEnv = fmt.Errorf("ErrorWrongAPIEnv: incorrect API env (production or development) privided within config") )
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v1.3.1
type API struct {
// contains filtered or unexported fields
}
API connects you to the GoDaddy endpoints
func NewProductionV1 ¶ added in v1.3.1
NewProductionV1 returns a new production v1 API
func (*API) CheckAvailability ¶ added in v1.3.1
CheckAvailability checks if a domain is available for purchase
type AddressMailing ¶ added in v1.3.1
type AddressMailing struct { Address string Address2 string City string Country string PostalCode string State string }
AddressMailing defines a mailing address
type Config ¶ added in v1.3.2
Config holds connection options
func NewConfig ¶ added in v1.3.2
NewConfig creates a config using `http.DefaultClient` as our client
- key is the api key
- secret is the api secret
- env is whether or not we are targeting prod or dev, use APIDevEnv or APIProdEnv
- version should be `v1` or `v2`, use APIVersion1 or APIVersion2
func NewConfigWithClient ¶ added in v1.3.2
NewConfigWithClient creates a config using a custom http client
- key is the api key
- secret is the api secret
- env is whether or not we are targeting prod or dev, use APIDevEnv or APIProdEnv
- version should be `v1` or `v2`, use APIVersion1 or APIVersion2
- c is your http client
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 API endpoint
type DomainDetails ¶ added in v1.3.1
type DomainDetails struct { AuthCode string ContactAdmin Contact ContactBilling Contact ContactRegistrant Contact ContactTech Contact CreatedAt time.Time DeletedAt time.Time TransferAwayEligibleAt time.Time Domain string DomainID int ExpirationProtected bool Expires time.Time ExposeWhois bool HoldRegistrar bool Locked bool NameServers []string Privacy bool RenewAuto bool RenewDeadline time.Time Status string SubAccountID string TransferProtected bool Verifications Verifications }
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 RealName ¶ added in v1.3.1
type RealName struct {
Status string
}
RealName defines the real name
type Record ¶ added in v1.3.1
type Record struct { Data string Name string Port int Priority int Protocol string Service string TTL int Type string Weight int }
Record defines a DNS record
type Records ¶ added in v1.3.1
type Records interface { List(ctx context.Context) ([]Record, error) FindByType(ctx context.Context, t string) ([]Record, error) FindByTypeAndName(ctx context.Context, t string, n string) ([]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 API endpoint
type Verifications ¶ added in v1.3.1
type Verifications struct { DomainName DomainName RealName RealName }
Verifications defines who verified purchases, etc..