Documentation ¶
Index ¶
- Constants
- type AccountResponse
- type BasicResponse
- type Contact
- type CreateDNSRecordResponse
- type DNSRecordRequest
- type DNSRecordResponse
- type Domain
- type GoName
- func (n *GoName) Account() (data AccountResponse, err error)
- func (n *GoName) CreateDNSRecord(domain string, record DNSRecordRequest) (data CreateDNSRecordResponse, err error)
- func (n *GoName) DeleteDNSRecord(domain, recordID string) (data BasicResponse, err error)
- func (n *GoName) Hello() (data HelloResponse, err error)
- func (n *GoName) ListDNSRecords(domainName string) (data ListDNSRecordsResponse, err error)
- func (n *GoName) ListDomains() (data ListDomainsResponse, err error)
- func (n *GoName) Login() error
- func (n *GoName) Logout() error
- type HelloResponse
- type ListDNSRecordsResponse
- type ListDomainsResponse
- type LoginResponse
- type Result
Constants ¶
const ( // NameAPIBaseURL Base URL to the production Name.com API NameAPIBaseURL = "https://api.name.com" // NameAPIBaseDevURL Base URL to the dev Name.com API NameAPIBaseDevURL = "https://api.dev.name.com" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountResponse ¶
type AccountResponse struct { Result Result `json:"result"` Username string `json:"username"` CreateDate string `json:"create_date"` DomainCount string `json:"domain_count"` AccountCredit string `json:"account_credit"` Contacts []Contact `json:"contacts"` }
AccountResponse response from /api/account/get
type BasicResponse ¶
type BasicResponse struct {
Result Result `json:"result"`
}
BasicResponse response with no other details
type Contact ¶
type Contact struct { Type []string `json:"type"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Organization string `json:"organization"` AddressLine1 string `json:"addressline1"` AddressLine2 string `json:"addressline2"` City string `json:"city"` State string `json:"state"` Phone string `json:"phone"` Fax string `json:"fax"` Email string `json:"email"` }
Contact account and registrant contact information
type CreateDNSRecordResponse ¶
type CreateDNSRecordResponse struct { Result Result `json:"result"` RecordID int `json:"record_id"` Name string `json:"name"` Type string `json:"type"` Content string `json:"content"` TTL int `json:"ttl"` CreateDate string `json:"create_date"` Priority int `json:"priority,omitempty"` }
CreateDNSRecordResponse response from /api/dns/create/:name
type DNSRecordRequest ¶
type DNSRecordRequest struct { RecordID int `json:"record_id"` Hostname string `json:"hostname"` Type string `json:"type"` Content string `json:"content"` TTL int `json:"ttl"` CreateDate string `json:"create_date"` Priority int `json:"priority,omitempty"` }
DNSRecordRequest DNS record *request* information because the API is stupid
type DNSRecordResponse ¶
type DNSRecordResponse struct { RecordID string `json:"record_id"` Name string `json:"name"` Type string `json:"type"` Content string `json:"content"` TTL string `json:"ttl"` CreateDate string `json:"create_date"` Priority string `json:"priority,omitempty"` }
DNSRecordResponse DNS record information
type Domain ¶
type Domain struct { TLD string `json:"tld"` CreateDate string `json:"create_date"` ExpireDate string `json:"expire_date"` Locked bool `json:"locked,omitempty"` Nameservers []string `json:"nameservers,omitempty"` Addons map[string]struct { Price string `json:"price"` } `json:"addons,omitempty"` WhoisPrivacy struct { Enabled bool `json:"enabled"` ExpireDate string `json:"expire_date"` } `json:"whois_privacy,omitempty"` Username string `json:"username,omitempty"` Contacts []Contact `json:"contacts,omitempty"` }
Domain domain information
type GoName ¶
type GoName struct { Client *http.Client Username string APIKey string BaseURL string SessionToken string }
GoName API controller
func (*GoName) Account ¶
func (n *GoName) Account() (data AccountResponse, err error)
Account retunrs the associated Name.com account information
func (*GoName) CreateDNSRecord ¶
func (n *GoName) CreateDNSRecord(domain string, record DNSRecordRequest) (data CreateDNSRecordResponse, err error)
CreateDNSRecord creates a record on a domain
func (*GoName) DeleteDNSRecord ¶
func (n *GoName) DeleteDNSRecord(domain, recordID string) (data BasicResponse, err error)
DeleteDNSRecord deletes a record on a domain
func (*GoName) Hello ¶
func (n *GoName) Hello() (data HelloResponse, err error)
Hello pings the name.com API
func (*GoName) ListDNSRecords ¶
func (n *GoName) ListDNSRecords(domainName string) (data ListDNSRecordsResponse, err error)
ListDNSRecords retrives records created on supplied domain name
func (*GoName) ListDomains ¶
func (n *GoName) ListDomains() (data ListDomainsResponse, err error)
ListDomains retrieves information about domains owned by an account
type HelloResponse ¶
type HelloResponse struct { Result Result `json:"result"` Service string `json:"service"` ServerDate string `json:"server_date"` Version string `json:"version"` Language string `json:"language"` ClientIP string `json:"client_ip"` }
HelloResponse response from /api/hello
type ListDNSRecordsResponse ¶
type ListDNSRecordsResponse struct { Result Result `json:"result"` Records []DNSRecordResponse `json:"records"` }
ListDNSRecordsResponse response from /api/dns/list/:name
type ListDomainsResponse ¶
type ListDomainsResponse struct { Result Result `json:"result"` Domains map[string]Domain `json:"domains"` }
ListDomainsResponse response from /api/domains/list
type LoginResponse ¶
type LoginResponse struct { Result Result `json:"result"` SessionToken string `json:"session_token"` }
LoginResponse response from /api/login