namecom

package
v0.0.0-...-08470be Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2018 License: MIT Imports: 8 Imported by: 135

Documentation

Overview

Package namecom provides a client for accessing the Name.com v4 API.

See https://www.name.com/api-docs for an introduction to the Name.com v4 API.

Creating a Client

To start working with this package, create a client with user credentials

nc := namecom.New("username","apitoken")

To check if the username and token are correct using the HelloFunc endpoint

response, err := nc.HelloFunc(&namecom.HelloRequest{})
if err != nil {
    // TODO: handle error
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthCodeRequest

type AuthCodeRequest struct {
	// DomainName is the domain name to retrieve the authorization code for.
	DomainName string `json:"domainName,omitempty"`
}

AuthCodeRequest passes the domain name to the GetAuthCodeForDomain funtion.

type AuthCodeResponse

type AuthCodeResponse struct {
	// AuthCode is the authorization code needed to transfer a domain to another registrar. If you are storing auth codes, be sure to store them in a secure manner.
	AuthCode string `json:"authCode,omitempty"`
}

AuthCodeResponse returns the auth code from the GetAuthCodeForDomain funtion.

type AvailabilityRequest

type AvailabilityRequest struct {
	// DomainNames is the list of domains to check if they are available.
	DomainNames []string `json:"domainNames,omitempty"`
	// PromoCode is not implemented yet.
	PromoCode string `json:"promoCode,omitempty"`
}

AvailabilityRequest is used to list the domain names to check availability for.

type CancelTransferRequest

type CancelTransferRequest struct {
	// DomainName is the domain to cancel the transfer for.
	DomainName string `json:"domainName,omitempty"`
}

CancelTransferRequest passes the domain name to be canceled to the CancelTransfer function.

type Contact

type Contact struct {
	// First name of the contact.
	FirstName string `json:"firstName,omitempty"`
	// Last name of the contact.
	LastName string `json:"lastName,omitempty"`
	// Company name of the contact. Leave blank if the contact is an individual as some registries will assume it is a corporate entity otherwise.
	CompanyName string `json:"companyName,omitempty"`
	// Address1 is the first line of the contact's address.
	Address1 string `json:"address1,omitempty"`
	// Address2 is the second line of the contact's address.
	Address2 string `json:"address2,omitempty"`
	// City of the contact's address.
	City string `json:"city,omitempty"`
	// State or Province for the contact's address.
	State string `json:"state,omitempty"`
	// Zip or Postal Code for the contact's address.
	Zip string `json:"zip,omitempty"`
	// Country code for the contact's address. Required to be a ISO 3166-1 alpha-2 code.
	Country string `json:"country,omitempty"`
	// Phone number of the contact. Should be specified in the following format: "+cc.llllllll" where cc is the country code and llllllll is the local number.
	Phone string `json:"phone,omitempty"`
	// Fax number of the contact. Should be specified in the following format: "+cc.llllllll" where cc is the country code and llllllll is the local number.
	Fax string `json:"fax,omitempty"`
	// Email of the contact. Should be a complete and valid email address.
	Email string `json:"email,omitempty"`
}

Contact contains all the contact data.

type Contacts

type Contacts struct {
	// Registrant is the rightful owner of the account and has the right to use and/or sell the domain name. They are able to make changes to all account, domain, and product settings. This information should be reviewed and updated regularly to ensure accuracy.
	Registrant *Contact `json:"registrant,omitempty"`
	// Registrants often designate an administrative contact to manage their domain name(s). They primarily deal with business information such as the name on record, postal address, and contact information for the official registrant.
	Admin *Contact `json:"admin,omitempty"`
	// The technical contact manages and maintains a domain’s nameservers. If you’re working with a web designer or someone in a similar role, you many want to assign them as a technical contact.
	Tech *Contact `json:"tech,omitempty"`
	// The billing contact is the party responsible for paying bills for the account and taking care of renewals.
	Billing *Contact `json:"billing,omitempty"`
}

Contacts stores the contact information for the roles related to domains.

type CreateDomainRequest

type CreateDomainRequest struct {
	// Domain is the domain object to create. If privacy_enabled is set, Whois Privacy will also be purchased for an additional amount.
	Domain *Domain `json:"domain,omitempty"`
	// PurchasePrice is the amount to pay for the domain. If privacy_enabled is set, the regular price for whois protection will be added automatically. If VAT tax applies, it will also be added automatically.
	// PurchasePrice is required if purchase_type is not "registration" or if it is a premium domain.
	PurchasePrice float64 `json:"purchasePrice,omitempty"`
	// PurchaseType defaults to "registration" but should be copied from the result of a search command otherwise.
	PurchaseType string `json:"purchaseType,omitempty"`
	// Years is for how many years to register the domain for. Years defaults to 1 if not passed and cannot be more than 10.
	// If passing purchase_price make sure to adjust it accordingly.
	Years int32 `json:"years,omitempty"`
	// TLDRequirements is a way to pass additional data that is required by some registries.
	TldRequirements map[string]string `json:"tldRequirements,omitempty"`
	// PromoCode is not yet implemented.
	PromoCode string `json:"promoCode,omitempty"`
}

CreateDomainRequest has the information that is needed to create a domain with the CreateDomain function.

type CreateDomainResponse

type CreateDomainResponse struct {
	// Domain is the newly created domain.
	Domain *Domain `json:"domain,omitempty"`
	// Order is an identifier for this purchase.
	Order int32 `json:"order,omitempty"`
	// TotalPaid is the total amount paid, including VAT and whois protection.
	TotalPaid float64 `json:"totalPaid,omitempty"`
}

CreateDomainResponse contains the domain info as well as the order info for the created domain.

type CreateTransferRequest

type CreateTransferRequest struct {
	// DomainName is the domain you want to transfer to Name.com.
	DomainName string `json:"domainName,omitempty"`
	// AuthCode is the authorization code for the transfer. Not all TLDs require authorization codes, but most do.
	AuthCode string `json:"authCode,omitempty"`
	// PrivacyEnabled is a flag on whether to purchase Whois Privacy with the transfer.
	PrivacyEnabled bool `json:"privacyEnabled,omitempty"`
	// PurchasePrice is the amount to pay for the transfer of the domain. If privacy_enabled is set, the regular price for Whois Privacy will be added automatically. If VAT tax applies, it will also be added automatically.
	// PurchasePrice is required if the domain to transfer is a premium domain.
	PurchasePrice float64 `json:"purchasePrice,omitempty"`
	// PromoCode is not implemented yet
	PromoCode string `json:"promoCode,omitempty"`
}

CreateTransferRequest passes the required transfer info to the CreateTransfer function.

type CreateTransferResponse

type CreateTransferResponse struct {
	// Transfer is the transfer resource created.
	Transfer *Transfer `json:"transfer,omitempty"`
	// Order is an identifier for this purchase.
	Order int32 `json:"order,omitempty"`
	// TotalPaid is the total amount paid, including VAT and Whois Privacy.
	TotalPaid float64 `json:"totalPaid,omitempty"`
}

CreateTransferResponse returns the newly created transfer resource as well as the order information.

type DNSSEC

type DNSSEC struct {
	// DomainName is the domain name.
	DomainName string `json:"domainName,omitempty"`
	// KeyTag contains the key tag value of the DNSKEY RR that validates this signature. The algorithm to generate it is here: https://tools.ietf.org/html/rfc4034#appendix-B
	KeyTag int32 `json:"keyTag,omitempty"`
	// Algorithm is an integer identifying the algorithm used for signing. Valid values can be found here: https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml
	Algorithm int32 `json:"algorithm,omitempty"`
	// DigestType is an integer identifying the algorithm used to create the digest. Valid values can be found here: https://www.iana.org/assignments/ds-rr-types/ds-rr-types.xhtml
	DigestType int32 `json:"digestType,omitempty"`
	// Digest is a digest of the DNSKEY RR that is registered with the registry.
	Digest string `json:"digest,omitempty"`
}

DNSSEC contains all the data required to create a DS record at the registry.

type DeleteDNSSECRequest

type DeleteDNSSECRequest struct {
	// DomainName is the domain name the key is registered for.
	DomainName string `json:"domainName,omitempty"`
	// Digest is the digest for the DNSKEY RR to remove from the registry.
	Digest string `json:"digest,omitempty"`
}

DeleteDNSSECRequest specifies the domain name and digest to remove from the registry.

type DeleteEmailForwardingRequest

type DeleteEmailForwardingRequest struct {
	// DomainName is the domain to delete the email forwarded box from.
	DomainName string `json:"domainName,omitempty"`
	// EmailBox is which email box to delete.
	EmailBox string `json:"emailBox,omitempty"`
}

DeleteEmailForwardingRequest passes the domain name and email box to the DeleteEmailForwarding function.

type DeleteRecordRequest

type DeleteRecordRequest struct {
	// DomainName is the zone that the record to be deleted exists in.
	DomainName string `json:"domainName,omitempty"`
	// ID is the server-assigned unique identifier for the Record to be deleted. If the Record with that ID does not exist in the specified Domain, an error is returned.
	ID int32 `json:"id,omitempty"`
}

DeleteRecordRequest deletes a specific record

type DeleteURLForwardingRequest

type DeleteURLForwardingRequest struct {
	// DomainName is the domain to delete the URL forwardind entry from.
	DomainName string `json:"domainName,omitempty"`
	// Host is the part of the domain name before the domain. i.e. www is the host for www.example.org.
	Host string `json:"host,omitempty"`
}

DeleteURLForwardingRequest is the request for the DeleteURLForwarding function.

type DeleteVanityNameserverRequest

type DeleteVanityNameserverRequest struct {
	// DomainName is the domain of the vanity nameserver to delete.
	DomainName string `json:"domainName,omitempty"`
	// Hostname is the hostname of the vanity nameserver to delete.
	Hostname string `json:"hostname,omitempty"`
}

DeleteVanityNameserverRequest passes which hostname to remove from the registry.

type DisableAutorenewForDomainRequest

type DisableAutorenewForDomainRequest struct {
	// DomainName is the domain name to disable autorenew for.
	DomainName string `json:"domainName,omitempty"`
}

DisableAutorenewForDomainRequest is used to pass the domain name to the DisableAutorenewForDomain function.

type Domain

type Domain struct {
	// DomainName is the punycode encoded value of the domain name.
	DomainName string `json:"domainName,omitempty"`
	// Nameservers is the list of nameservers for this domain. If unspecified it defaults to your account default nameservers.
	Nameservers []string `json:"nameservers,omitempty"`
	// Contacts for the domain.
	Contacts *Contacts `json:"contacts,omitempty"`
	// PrivacyEnabled reflects if Whois Privacy is enabled for this domain.
	PrivacyEnabled bool `json:"privacyEnabled,omitempty"`
	// Locked indicates that the domain cannot be transfered to another registrar.
	Locked bool `json:"locked,omitempty"`
	// AutorenewEnabled indicates if the domain will attempt to renew automatically before expiration.
	AutorenewEnabled bool `json:"autorenewEnabled,omitempty"`
	// ExpireDate is the date the domain will expire.
	ExpireDate string `json:"expireDate,omitempty"`
	// CreateDate is the date the domain was created at the registry.
	CreateDate string `json:"createDate,omitempty"`
	// RenewalPrice is the price to renew the domain. It may be required for the RenewDomain command.
	RenewalPrice float64 `json:"renewalPrice,omitempty"`
}

Domain lists all the data for a domain.

type EmailForwarding

type EmailForwarding struct {
	// DomainName is the domain part of the email address to forward.
	DomainName string `json:"domainName,omitempty"`
	// EmailBox is the user portion of the email address to forward.
	EmailBox string `json:"emailBox,omitempty"`
	// EmailTo is the entire email address to forward email to.
	EmailTo string `json:"emailTo,omitempty"`
}

EmailForwarding contains all the information for an email forwarding entry.

type EmptyResponse

type EmptyResponse struct {
}

EmptyResponse is an empty response used for DELETE endpoints.

type EnableAutorenewForDomainRequest

type EnableAutorenewForDomainRequest struct {
	// DomainName is the domain name to enable autorenew for.
	DomainName string `json:"domainName,omitempty"`
}

EnableAutorenewForDomainRequest is used to pass the domain name to the EnableAutorenewForDomain function.

type ErrorResponse

type ErrorResponse struct {
	// Message is the error message.
	Message string `json:"message,omitempty"`
	// Details may have some additional details about the error.
	Details string `json:"details,omitempty"`
}

ErrorResponse is what is returned if the HTTP status code is not 200.

func (ErrorResponse) Error

func (er ErrorResponse) Error() string

Error allows an ErrorResponse object to implement the error interface.

type GetDNSSECRequest

type GetDNSSECRequest struct {
	// DomainName is the domain name.
	DomainName string `json:"domainName,omitempty"`
	// Digest is the digest for the DNSKEY RR to retrieve.
	Digest string `json:"digest,omitempty"`
}

GetDNSSECRequest gets the information for a specific DS record at the registry.

type GetDomainRequest

type GetDomainRequest struct {
	// DomainName is the domain to retrieve.
	DomainName string `json:"domainName,omitempty"`
}

GetDomainRequest specifies the domain name to request data for in the GetDomain function.

type GetEmailForwardingRequest

type GetEmailForwardingRequest struct {
	// DomainName is the domain to list email forwarded box for.
	DomainName string `json:"domainName,omitempty"`
	// EmailBox is which email box to retrieve.
	EmailBox string `json:"emailBox,omitempty"`
}

GetEmailForwardingRequest passes the domain name and email box to request the email forwarding information for.

type GetRecordRequest

type GetRecordRequest struct {
	// DomainName is the zone the record exists in
	DomainName string `json:"domainName,omitempty"`
	// ID is the server-assigned unique identifier for this record
	ID int32 `json:"id,omitempty"`
}

GetRecordRequest requests the record identified by id and domain.

type GetTransferRequest

type GetTransferRequest struct {
	// DomainName is the domain you want to get the transfer information for.
	DomainName string `json:"domainName,omitempty"`
}

GetTransferRequest passes the domain name to the GetTransfer function.

type GetURLForwardingRequest

type GetURLForwardingRequest struct {
	// DomainName is the domain to list URL forwarding entry for.
	DomainName string `json:"domainName,omitempty"`
	// Host is the part of the domain name before the domain. i.e. www is the host for www.example.org.
	Host string `json:"host,omitempty"`
}

GetURLForwardingRequest is the request for the GetURLForwarding function.

type GetVanityNameserverRequest

type GetVanityNameserverRequest struct {
	// DomainName is the domain to for the vanity nameserver.
	DomainName string `json:"domainName,omitempty"`
	// Hostname is the hostname for the vanity nameserver.
	Hostname string `json:"hostname,omitempty"`
}

GetVanityNameserverRequest passes the hostname to get the details for.

type HelloRequest

type HelloRequest struct {
}

HelloRequest doesn't take any parameters.

type HelloResponse

type HelloResponse struct {
	// ServerName is an identfier for which server is being accessed.
	ServerName string `json:"serverName,omitempty"`
	// Motd is a message of the day. It might provide some useful information.
	Motd string `json:"motd,omitempty"`
	// Username is the account name you are currently logged into.
	Username string `json:"username,omitempty"`
	// ServerTime is the current date/time at the server.
	ServerTime string `json:"serverTime,omitempty"`
}

HelloResponse is the response from the HelloFunc command

type ListDNSSECsRequest

type ListDNSSECsRequest struct {
	// DomainName is the domain name to list keys for.
	DomainName string `json:"domainName,omitempty"`
}

ListDNSSECsRequest contains the domain name to list DS records for.

type ListDNSSECsResponse

type ListDNSSECsResponse struct {
	// Dnssec is the list of registered DNSSEC keys.
	Dnssec []*DNSSEC `json:"dnssec,omitempty"`
	// NextPage is the identifier for the next page of results. It is only populated if there is another page of results after the current page.
	NextPage int32 `json:"nextPage,omitempty"`
	// LastPage is the identifier for the final page of results. It is only populated if there is another page of results after the current page.
	LastPage int32 `json:"lastPage,omitempty"`
}

ListDNSSECsResponse contains the list of DS records at the registry.

type ListDomainsRequest

type ListDomainsRequest struct {
	// Per Page is the number of records to return per request. Per Page defaults to 1,000.
	PerPage int32 `json:"perPage,omitempty"`
	// Page is which page to return
	Page int32 `json:"page,omitempty"`
}

ListDomainsRequest is used to pass the pagination parameters to the ListDomains function.

type ListDomainsResponse

type ListDomainsResponse struct {
	// Domains is the list of domains in your account.
	Domains []*Domain `json:"domains,omitempty"`
	// NextPage is the identifier for the next page of results. It is only populated if there is another page of results after the current page.
	NextPage int32 `json:"nextPage,omitempty"`
	// LastPage is the identifier for the final page of results. It is only populated if there is another page of results after the current page.
	LastPage int32 `json:"lastPage,omitempty"`
}

ListDomainsResponse is the response from a list request, it contains the paginated list of Domains.

type ListEmailForwardingsRequest

type ListEmailForwardingsRequest struct {
	// DomainName is the domain to list email forwarded boxes for.
	DomainName string `json:"domainName,omitempty"`
	// Per Page is the number of records to return per request. Per Page defaults to 1,000.
	PerPage int32 `json:"perPage,omitempty"`
	// Page is which page to return.
	Page int32 `json:"page,omitempty"`
}

ListEmailForwardingsRequest passes the domain name and pagination information to the ListEmailForwardings function.

type ListEmailForwardingsResponse

type ListEmailForwardingsResponse struct {
	// EmailForwarding is the list of forwarded email boxes.
	EmailForwarding []*EmailForwarding `json:"emailForwarding,omitempty"`
	// NextPage is the identifier for the next page of results. It is only populated if there is another page of results after the current page.
	NextPage int32 `json:"nextPage,omitempty"`
	// LastPage is the identifier for the final page of results. It is only populated if there is another page of results after the current page.
	LastPage int32 `json:"lastPage,omitempty"`
}

ListEmailForwardingsResponse returns the list of email forwarding entries as well as the pagination information.

type ListRecordsRequest

type ListRecordsRequest struct {
	// DomainName is the zone to list the records for.
	DomainName string `json:"domainName,omitempty"`
	// Per Page is the number of records to return per request. Per Page defaults to 1,000.
	PerPage int32 `json:"perPage,omitempty"`
	// Page is which page to return
	Page int32 `json:"page,omitempty"`
}

ListRecordsRequest requests a list of records that exist for the domain

type ListRecordsResponse

type ListRecordsResponse struct {
	// Records contains the records in the zone
	Records []*Record `json:"records,omitempty"`
	// NextPage is the identifier for the next page of results. It is only populated if there is another page of results after the current page.
	NextPage int32 `json:"nextPage,omitempty"`
	// LastPage is the identifier for the final page of results. It is only populated if there is another page of results after the current page.
	LastPage int32 `json:"lastPage,omitempty"`
}

ListRecordsResponse is the response for the ListRecords function.

type ListTransfersRequest

type ListTransfersRequest struct {
	// Per Page is the number of records to return per request. Per Page defaults to 1,000.
	PerPage int32 `json:"perPage,omitempty"`
	// Page is which page to return
	Page int32 `json:"page,omitempty"`
}

ListTransfersRequest passes the pagination information to the ListTransfers function.

type ListTransfersResponse

type ListTransfersResponse struct {
	// Transfers is a list of pending transfers
	Transfers []*Transfer `json:"transfers,omitempty"`
	// NextPage is the identifier for the next page of results. It is only populated if there is another page of results after the current page.
	NextPage int32 `json:"nextPage,omitempty"`
	// LastPage is the identifier for the final page of results. It is only populated if there is another page of results after the current page.
	LastPage int32 `json:"lastPage,omitempty"`
}

ListTransfersResponse returns the list of pending transfers as well as the paginiation information if relevent.

type ListURLForwardingsRequest

type ListURLForwardingsRequest struct {
	// DomainName is the domain to list URL forwarding entries for.
	DomainName string `json:"domainName,omitempty"`
	// Per Page is the number of records to return per request. Per Page defaults to 1,000.
	PerPage int32 `json:"perPage,omitempty"`
	// Page is which page to return.
	Page int32 `json:"page,omitempty"`
}

ListURLForwardingsRequest is the request for the ListURLForwardings function.

type ListURLForwardingsResponse

type ListURLForwardingsResponse struct {
	// URLForwarding is the list of URL forwarding entries.
	URLForwarding []*URLForwarding `json:"urlForwarding,omitempty"`
	// NextPage is the identifier for the next page of results. It is only populated if there is another page of results after the current page.
	NextPage int32 `json:"nextPage,omitempty"`
	// LastPage is the identifier for the final page of results. It is only populated if there is another page of results after the current page.
	LastPage int32 `json:"lastPage,omitempty"`
}

ListURLForwardingsResponse is the response for the ListURLForwardings function.

type ListVanityNameserversRequest

type ListVanityNameserversRequest struct {
	// DomainName is the domain to list the vanity nameservers for.
	DomainName string `json:"domainName,omitempty"`
	// Per Page is the number of records to return per request. Per Page defaults to 1,000.
	PerPage int32 `json:"perPage,omitempty"`
	// Page is which page to return
	Page int32 `json:"page,omitempty"`
}

ListVanityNameserversRequest passes the domain name as well as the pagination parameters to the ListVanityNameservers function.

type ListVanityNameserversResponse

type ListVanityNameserversResponse struct {
	// VanityNameservers is the list of vanity nameservers.
	VanityNameservers []*VanityNameserver `json:"vanityNameservers,omitempty"`
	// NextPage is the identifier for the next page of results. It is only populated if there is another page of results after the current page.
	NextPage int32 `json:"nextPage,omitempty"`
	// LastPage is the identifier for the final page of results. It is only populated if there is another page of results after the current page.
	LastPage int32 `json:"lastPage,omitempty"`
}

ListVanityNameserversResponse returns the list of vanity nameservers for the domain.

type LockDomainRequest

type LockDomainRequest struct {
	// DomainName is the domain name to lock.
	DomainName string `json:"domainName,omitempty"`
}

LockDomainRequest is used to pass the domain name to the LockDomain function.

type NameCom

type NameCom struct {
	Server string
	User   string
	Token  string
	Client *http.Client
}

NameCom is a client for connecting to the Name.com API.

func New

func New(user, token string) *NameCom

New creates a new NameCom client using the production environment server endpoint.

func Test

func Test(user, token string) *NameCom

Test creates a new NameCom client using the test environment server enpoint.

func (*NameCom) CancelTransfer

func (n *NameCom) CancelTransfer(request *CancelTransferRequest) (*Transfer, error)

CancelTransfer cancels a pending transfer request and refunds the amount to account credit.

func (*NameCom) CheckAvailability

func (n *NameCom) CheckAvailability(request *AvailabilityRequest) (*SearchResponse, error)

CheckAvailability will check a list of domains to see if they are purchaseable. A Maximum of 50 domains can be specified.

func (*NameCom) CreateDNSSEC

func (n *NameCom) CreateDNSSEC(request *DNSSEC) (*DNSSEC, error)

CreateDNSSEC registers a DNSSEC key with the registry.

func (*NameCom) CreateDomain

func (n *NameCom) CreateDomain(request *CreateDomainRequest) (*CreateDomainResponse, error)

CreateDomain purchases a new domain. Domains that are not regularly priced require the purchase_price field to be specified.

func (*NameCom) CreateEmailForwarding

func (n *NameCom) CreateEmailForwarding(request *EmailForwarding) (*EmailForwarding, error)

CreateEmailForwarding creates an email forwarding entry. If this is the first email forwarding entry, it may modify the MX records for the domain accordingly.

func (*NameCom) CreateRecord

func (n *NameCom) CreateRecord(request *Record) (*Record, error)

CreateRecord creates a new record in the zone.

func (*NameCom) CreateTransfer

func (n *NameCom) CreateTransfer(request *CreateTransferRequest) (*CreateTransferResponse, error)

CreateTransfer purchases a new domain transfer request.

func (*NameCom) CreateURLForwarding

func (n *NameCom) CreateURLForwarding(request *URLForwarding) (*URLForwarding, error)

CreateURLForwarding creates an URL forwarding entry. If this is the first URL forwarding entry, it may modify the A records for the domain accordingly.

func (*NameCom) CreateVanityNameserver

func (n *NameCom) CreateVanityNameserver(request *VanityNameserver) (*VanityNameserver, error)

CreateVanityNameserver registers a nameserver with the registry.

func (*NameCom) DeleteDNSSEC

func (n *NameCom) DeleteDNSSEC(request *DeleteDNSSECRequest) (*EmptyResponse, error)

DeleteDNSSEC removes a DNSSEC key from the registry.

func (*NameCom) DeleteEmailForwarding

func (n *NameCom) DeleteEmailForwarding(request *DeleteEmailForwardingRequest) (*EmptyResponse, error)

DeleteEmailForwarding deletes the email forwarding entry.

func (*NameCom) DeleteRecord

func (n *NameCom) DeleteRecord(request *DeleteRecordRequest) (*EmptyResponse, error)

DeleteRecord deletes a record from the zone.

func (*NameCom) DeleteURLForwarding

func (n *NameCom) DeleteURLForwarding(request *DeleteURLForwardingRequest) (*EmptyResponse, error)

DeleteURLForwarding deletes the URL forwarding entry.

func (*NameCom) DeleteVanityNameserver

func (n *NameCom) DeleteVanityNameserver(request *DeleteVanityNameserverRequest) (*EmptyResponse, error)

DeleteVanityNameserver unregisteres the nameserver at the registry. This might fail if the registry believes the nameserver is in use.

func (*NameCom) DisableAutorenew

func (n *NameCom) DisableAutorenew(request *DisableAutorenewForDomainRequest) (*Domain, error)

DisableAutorenew disables automatic renewals, thus requiring the domain to be renewed manually.

func (*NameCom) EnableAutorenew

func (n *NameCom) EnableAutorenew(request *EnableAutorenewForDomainRequest) (*Domain, error)

EnableAutorenew enables the domain to be automatically renewed when it gets close to expiring.

func (*NameCom) GetAuthCodeForDomain

func (n *NameCom) GetAuthCodeForDomain(request *AuthCodeRequest) (*AuthCodeResponse, error)

GetAuthCodeForDomain returns the Transfer Authorization Code for the domain.

func (*NameCom) GetDNSSEC

func (n *NameCom) GetDNSSEC(request *GetDNSSECRequest) (*DNSSEC, error)

GetDNSSEC retrieves the details for a key registered with the registry.

func (*NameCom) GetDomain

func (n *NameCom) GetDomain(request *GetDomainRequest) (*Domain, error)

GetDomain returns details about a specific domain

func (*NameCom) GetEmailForwarding

func (n *NameCom) GetEmailForwarding(request *GetEmailForwardingRequest) (*EmailForwarding, error)

GetEmailForwarding returns an email forwarding entry.

func (*NameCom) GetRecord

func (n *NameCom) GetRecord(request *GetRecordRequest) (*Record, error)

GetRecord returns details about an individual record.

func (*NameCom) GetTransfer

func (n *NameCom) GetTransfer(request *GetTransferRequest) (*Transfer, error)

GetTransfer gets details for a transfer request.

func (*NameCom) GetURLForwarding

func (n *NameCom) GetURLForwarding(request *GetURLForwardingRequest) (*URLForwarding, error)

GetURLForwarding returns an URL forwarding entry.

func (*NameCom) GetVanityNameserver

func (n *NameCom) GetVanityNameserver(request *GetVanityNameserverRequest) (*VanityNameserver, error)

GetVanityNameserver gets the details for a vanity nameserver registered with the registry.

func (*NameCom) HelloFunc

func (n *NameCom) HelloFunc(request *HelloRequest) (*HelloResponse, error)

HelloFunc returns some information about the API server.

func (*NameCom) ListDNSSECs

func (n *NameCom) ListDNSSECs(request *ListDNSSECsRequest) (*ListDNSSECsResponse, error)

ListDNSSECs lists all of the DNSSEC keys registered with the registry.

func (*NameCom) ListDomains

func (n *NameCom) ListDomains(request *ListDomainsRequest) (*ListDomainsResponse, error)

ListDomains returns all domains in the account. It omits some information that can be retrieved from GetDomain.

func (*NameCom) ListEmailForwardings

func (n *NameCom) ListEmailForwardings(request *ListEmailForwardingsRequest) (*ListEmailForwardingsResponse, error)

ListEmailForwardings returns a pagenated list of email forwarding entries for a domain.

func (*NameCom) ListRecords

func (n *NameCom) ListRecords(request *ListRecordsRequest) (*ListRecordsResponse, error)

ListRecords returns all records for a zone.

func (*NameCom) ListTransfers

func (n *NameCom) ListTransfers(request *ListTransfersRequest) (*ListTransfersResponse, error)

ListTransfers lists all pending transfer in requests. To get the information related to a non-pending transfer, you can use the GetTransfer function for that.

func (*NameCom) ListURLForwardings

func (n *NameCom) ListURLForwardings(request *ListURLForwardingsRequest) (*ListURLForwardingsResponse, error)

ListURLForwardings returns a pagenated list of URL forwarding entries for a domain.

func (*NameCom) ListVanityNameservers

func (n *NameCom) ListVanityNameservers(request *ListVanityNameserversRequest) (*ListVanityNameserversResponse, error)

ListVanityNameservers lists all nameservers registered with the registry. It omits the IP addresses from the response. Those can be found from calling GetVanityNameserver.

func (*NameCom) LockDomain

func (n *NameCom) LockDomain(request *LockDomainRequest) (*Domain, error)

LockDomain will lock a domain so that it cannot be transfered to another registrar.

func (*NameCom) PurchasePrivacy

func (n *NameCom) PurchasePrivacy(request *PrivacyRequest) (*PrivacyResponse, error)

PurchasePrivacy will add Whois Privacy protection to a domain or will an renew existing subscription.

func (*NameCom) RenewDomain

func (n *NameCom) RenewDomain(request *RenewDomainRequest) (*RenewDomainResponse, error)

RenewDomain will renew a domain. Purchase_price is required if the renewal is not regularly priced.

func (*NameCom) Search

func (n *NameCom) Search(request *SearchRequest) (*SearchResponse, error)

Search will perform a search for specified keywords.

func (*NameCom) SearchStream

func (n *NameCom) SearchStream(request *SearchRequest) (*SearchResult, error)

SearchStream will return JSON encoded SearchResults as they are recieved from the registry. The SearchResults are separated by newlines. This can allow clients to react to results before the search is fully completed.

func (*NameCom) SetContacts

func (n *NameCom) SetContacts(request *SetContactsRequest) (*Domain, error)

SetContacts will set the contacts for the Domain.

func (*NameCom) SetNameservers

func (n *NameCom) SetNameservers(request *SetNameserversRequest) (*Domain, error)

SetNameservers will set the nameservers for the Domain.

func (*NameCom) UnlockDomain

func (n *NameCom) UnlockDomain(request *UnlockDomainRequest) (*Domain, error)

UnlockDomain will unlock a domain so that it can be transfered to another registrar.

func (*NameCom) UpdateEmailForwarding

func (n *NameCom) UpdateEmailForwarding(request *EmailForwarding) (*EmailForwarding, error)

UpdateEmailForwarding updates which email address the email is being forwarded to.

func (*NameCom) UpdateRecord

func (n *NameCom) UpdateRecord(request *Record) (*Record, error)

UpdateRecord replaces the record with the new record that is passed.

func (*NameCom) UpdateURLForwarding

func (n *NameCom) UpdateURLForwarding(request *URLForwarding) (*URLForwarding, error)

UpdateURLForwarding updates which URL the host is being forwarded to.

func (*NameCom) UpdateVanityNameserver

func (n *NameCom) UpdateVanityNameserver(request *VanityNameserver) (*VanityNameserver, error)

UpdateVanityNameserver allows you to update the glue record IP addresses at the registry.

type PrivacyRequest

type PrivacyRequest struct {
	// DomainName is the domain to purchase Whois Privacy for.
	DomainName string `json:"domainName,omitempty"`
	// PurchasePrice is the amount you expect to pay.
	PurchasePrice float64 `json:"purchasePrice,omitempty"`
	// Years is the number of years you wish to purchase Whois Privacy for. Years defaults to 1 and cannot be more then the domain expiration date.
	Years int32 `json:"years,omitempty"`
	// PromoCode is not yet implemented
	PromoCode string `json:"promoCode,omitempty"`
}

PrivacyRequest passes the domain name as well as the purchase parameters to the PurchasePrivacy function.

type PrivacyResponse

type PrivacyResponse struct {
	// Domain is the status of the domain after the purchase of Whois Privacy.
	Domain *Domain `json:"domain,omitempty"`
	// Order is an identifier for this purchase.
	Order int32 `json:"order,omitempty"`
	// TotalPaid is the total amount paid, including VAT.
	TotalPaid float64 `json:"totalPaid,omitempty"`
}

PrivacyResponse contains the updated domain info as well as the order info for the newly purchased Whois Privacy.

type Record

type Record struct {
	// Unique record id. Value is ignored on Create, and must match the URI on Update.
	ID int32 `json:"id,omitempty"`
	// DomainName is the zone that the record belongs to.
	DomainName string `json:"domainName,omitempty"`
	// Host is the hostname relative to the zone: e.g. for a record for blog.example.org, domain would be "example.org" and host would be "blog".
	// An apex record would be specified by either an empty host "" or "@".
	// A SRV record would be specified by "_{service}._{protocal}.{host}": e.g. "_sip._tcp.phone" for _sip._tcp.phone.example.org.
	Host string `json:"host,omitempty"`
	// FQDN is the Fully Qualified Domain Name. It is the combination of the host and the domain name. It always ends in a ".". FQDN is ignored in CreateRecord, specify via the Host field instead.
	Fqdn string `json:"fqdn,omitempty"`
	// Type is one of the following: A, AAAA, ANAME, CNAME, MX, NS, SRV, or TXT.
	Type string `json:"type,omitempty"`
	// Answer is either the IP address for A or AAAA records; the target for ANAME, CNAME, MX, or NS records; the text for TXT records.
	// For SRV records, answer has the following format: "{weight} {port} {target}" e.g. "1 5061 sip.example.org".
	Answer string `json:"answer,omitempty"`
	// TTL is the time this record can be cached for in seconds. Name.com allows a minimum TTL of 300, or 5 minutes.
	TTL uint32 `json:"ttl,omitempty"`
	// Priority is only required for MX and SRV records, it is ignored for all others.
	Priority uint32 `json:"priority,omitempty"`
}

Record is an individual DNS resource record.

type RenewDomainRequest

type RenewDomainRequest struct {
	// DomainName is the domain to renew.
	DomainName string `json:"domainName,omitempty"`
	// PurchasePrice is the amount to pay for the domain renewal. If VAT tax applies, it will also be added automatically.
	// PurchasePrice is required if this is a premium domain.
	PurchasePrice float64 `json:"purchasePrice,omitempty"`
	// Years is for how many years to renew the domain for. Years defaults to 1 if not passed and cannot be more than 10.
	Years int32 `json:"years,omitempty"`
	// PromoCode is not yet implemented.
	PromoCode string `json:"promoCode,omitempty"`
}

RenewDomainRequest passes the domain name and purchase parameters to the RenewDomain function.

type RenewDomainResponse

type RenewDomainResponse struct {
	// Domain reflects the status of the domain after renewing.
	Domain *Domain `json:"domain,omitempty"`
	// Order is an identifier for this purchase
	Order int32 `json:"order,omitempty"`
	// TotalPaid is the total amount paid, including VAT.
	TotalPaid float64 `json:"totalPaid,omitempty"`
}

RenewDomainResponse contains the updated domain info as well as the order info for the renewed domain.

type SearchRequest

type SearchRequest struct {
	// Timeout is a value in milliseconds on how long to perform the search for. Valid timeouts are between 500ms to 5,000ms. If not specified, timeout defaults to 1,000ms.
	// Since some additional processing is performed on the results, a response may take longer then the timeout.
	Timeout int32 `json:"timeout,omitempty"`
	// Keyword is the search term to search for. It can be just a word, or a whole domain name.
	Keyword string `json:"keyword,omitempty"`
	// TLDFilter will limit results to only contain the specified TLDs.
	TldFilter []string `json:"tldFilter,omitempty"`
	// PromoCode is not implemented yet.
	PromoCode string `json:"promoCode,omitempty"`
}

SearchRequest is used to specify the search parameters.

type SearchResponse

type SearchResponse struct {
	// Results of the search are returned here, the order should not be relied upon.
	Results []*SearchResult `json:"results,omitempty"`
}

SearchResponse returns a list of search results.

type SearchResult

type SearchResult struct {
	// DomainName is the punycode encoding of the result domain name.
	DomainName string `json:"domainName,omitempty"`
	// SLD is first portion of the domain_name.
	Sld string `json:"sld,omitempty"`
	// TLD is the rest of the domain_name after the SLD.
	Tld string `json:"tld,omitempty"`
	// Purchaseable indicates whether the search result is available for purchase.
	Purchasable bool `json:"purchasable,omitempty"`
	// Premium indicates that this search result is a premium result and the purchase_price needs to be passed to the DomainCreate command.
	Premium bool `json:"premium,omitempty"`
	// PurchasePrice is the price for purchasing this domain for 1 year. Purchase_price is always in USD.
	PurchasePrice float64 `json:"purchasePrice,omitempty"`
	// PurchaseType indicates what kind of purchase this result is for. It should be passed to the DomainCreate command.
	PurchaseType string `json:"purchaseType,omitempty"`
	// RenewalPrice is the annual renewal price for this domain as it may be different then the purchase_price.
	RenewalPrice float64 `json:"renewalPrice,omitempty"`
}

SearchResult is returned by the CheckAvailability, Search, and SearchStream functions.

type SetContactsRequest

type SetContactsRequest struct {
	// DomainName is the domain name to set the contacts for.
	DomainName string `json:"domainName,omitempty"`
	// Contacts is the list of contacts to set.
	Contacts *Contacts `json:"contacts,omitempty"`
}

SetContactsRequest passes the contact info for each role to the SetContacts function.

type SetNameserversRequest

type SetNameserversRequest struct {
	// DomainName is the domain name to set the nameservers for.
	DomainName string `json:"domainName,omitempty"`
	// Namesevers is a list of the nameservers to set. Nameservers should already be set up and hosting the zone properly as some registries will verify before allowing the change.
	Nameservers []string `json:"nameservers,omitempty"`
}

SetNameserversRequest passes the list of nameservers to set for the SetNameserver function.

type Transfer

type Transfer struct {
	// DomainName is the domain to be transfered to Name.com.
	DomainName string `json:"domainName,omitempty"`
	// Email is the email address that the approval email was sent to. Not every TLD requries an approval email. This is usaully pulled from Whois.
	Email string `json:"email,omitempty"`
	// Status is the current status of the transfer. Details about statuses can be found in the following Knowledge Base article: <https://www.name.com/support/articles/115012519688-Transfer-status-FAQ>.
	Status string `json:"status,omitempty"`
}

Transfer contains the information related to a transfer of a domain name to Name.com.

type URLForwarding

type URLForwarding struct {
	// DomainName is the domain part of the hostname to forward.
	DomainName string `json:"domainName,omitempty"`
	// Host is the entirety of the hostname. i.e. www.example.org
	Host string `json:"host,omitempty"`
	// ForwardsTo is the URL this host will be forwarded to.
	ForwardsTo string `json:"forwardsTo,omitempty"`
	// Type is the type of forwarding. Valid types are: Masked - This retains the original domain in the address bar and will not reveal or display the actual destination URL. If you are forwarding knowledgebase.ninja to Name.com, the address bar will say knowledgebase.ninja. This is sometimes called iframe forwarding. And: Redirect - This does not retain the original domain in the address bar, so the user will see it change and realize they were forwarded from the URL they originally entered. If you are forwarding knowledgebase.ninja to Name.com, the address bar will say Name.com. This is also called 301 forwarding.
	Type string `json:"type,omitempty"`
	// Title is the title for the html page to use if the type is masked. Values are ignored for types other then "masked".
	Title string `json:"title,omitempty"`
	// Meta is the meta tags to add to the html page if the type is masked. ex: "<meta name='keywords' content='fish, denver, platte'>". Values are ignored for types other then "masked".
	Meta string `json:"meta,omitempty"`
}

URLForwarding is the model for URL forwarding entries.

type UnlockDomainRequest

type UnlockDomainRequest struct {
	// DomainName is the domain name to unlock.
	DomainName string `json:"domainName,omitempty"`
}

UnlockDomainRequest is used to pass the domain name to the UnlockDomain function.

type VanityNameserver

type VanityNameserver struct {
	// DomainName is the domain the nameserver is a subdomain of.
	DomainName string `json:"domainName,omitempty"`
	// Hostname is the hostname of the nameserver.
	Hostname string `json:"hostname,omitempty"`
	// IPs is a list of IP addresses that are used for glue records for this nameserver.
	Ips []string `json:"ips,omitempty"`
}

VanityNameserver contains the hostname as well as the list of IP addresses for nameservers.

Jump to

Keyboard shortcuts

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