dnsimple-go: github.com/dnsimple/dnsimple-go/dnsimple Index | Files | Directories

package dnsimple

import "github.com/dnsimple/dnsimple-go/dnsimple"

Package dnsimple provides a client for the DNSimple API. In order to use this package you will need a DNSimple account.

Index

Package Files

accounts.go authentication.go certificates.go contacts.go dnsimple.go domains.go domains_collaborators.go domains_delegation_signer_records.go domains_dnssec.go domains_email_forwards.go domains_pushes.go identity.go oauth.go registrar.go registrar_auto_renewal.go registrar_delegation.go registrar_whois_privacy.go services.go services_domains.go templates.go templates_domains.go templates_records.go tlds.go users.go vanity_name_server.go webhooks.go zone_distributions.go zones.go zones_records.go

Constants

const (
    // AuthorizationCodeGrant is the type of access token request
    // for an Authorization Code Grant flow.
    // https://tools.ietf.org/html/rfc6749#section-4.1
    AuthorizationCodeGrant = GrantType("authorization_code")
)
const (
    // Version identifies the current library version.
    // This is a pro-forma convention given that Go dependencies
    // tends to be fetched directly from the repo.
    // It is also used in the user-agent identify the client.
    Version = "0.63.0"
)

func BasicAuthHTTPClient Uses

func BasicAuthHTTPClient(_ context.Context, username, password string) *http.Client

BasicAuthHTTPClient returns a client that authenticates via HTTP Basic Auth with given username and password.

func CheckResponse Uses

func CheckResponse(resp *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if the status code is different than 2xx. Specific requests may have additional requirements, but this is sufficient in most of the cases.

func Int Uses

func Int(v int) *int

Int is a helper routine that allocates a new int value to store v and returns a pointer to it.

func Int64 Uses

func Int64(v int64) *int64

Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it.

func StaticTokenHTTPClient Uses

func StaticTokenHTTPClient(ctx context.Context, token string) *http.Client

StaticTokenHTTPClient returns a client that authenticates with a static OAuth token.

func String Uses

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

type AccessToken Uses

type AccessToken struct {
    Token     string `json:"access_token"`
    Type      string `json:"token_type"`
    AccountID int64  `json:"account_id"`
}

AccessToken represents a DNSimple Oauth access token.

type Account Uses

type Account struct {
    ID             int64  `json:"id,omitempty"`
    Email          string `json:"email,omitempty"`
    PlanIdentifier string `json:"plan_identifier,omitempty"`
    CreatedAt      string `json:"created_at,omitempty"`
    UpdatedAt      string `json:"updated_at,omitempty"`
}

Account represents a DNSimple account.

type AccountInvitation Uses

type AccountInvitation struct {
    ID                   int64  `json:"id,omitempty"`
    Email                string `json:"email,omitempty"`
    Token                string `json:"token,omitempty"`
    AccountID            int64  `json:"account_id,omitempty"`
    CreatedAt            string `json:"created_at,omitempty"`
    UpdatedAt            string `json:"updated_at,omitempty"`
    InvitationSentAt     string `json:"invitation_sent_at,omitempty"`
    InvitationAcceptedAt string `json:"invitation_accepted_at,omitempty"`
}

AccountInvitation represents an invitation to a DNSimple account.

type AccountsResponse Uses

type AccountsResponse struct {
    Response
    Data []Account `json:"data"`
}

AccountsResponse represents a response from an API method that returns a collection of Account struct.

type AccountsService Uses

type AccountsService struct {
    // contains filtered or unexported fields
}

AccountsService handles communication with the account related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/accounts/

func (*AccountsService) ListAccounts Uses

func (s *AccountsService) ListAccounts(ctx context.Context, options *ListOptions) (*AccountsResponse, error)

ListAccounts list the accounts for an user.

See https://developer.dnsimple.com/v2/accounts/#list

type AuthorizationOptions Uses

type AuthorizationOptions struct {
    RedirectURI string `url:"redirect_uri,omitempty"`
    // A randomly generated string to verify the validity of the request.
    // Currently "state" is required by the DNSimple OAuth implementation, so you must specify it.
    State string `url:"state,omitempty"`
}

AuthorizationOptions represents the option you can use to generate an authorization URL.

type BasicAuthTransport Uses

type BasicAuthTransport struct {
    Username string
    Password string

    // Transport is the transport RoundTripper used to make HTTP requests.
    // If nil, http.DefaultTransport is used.
    Transport http.RoundTripper
}

BasicAuthTransport is an http.RoundTripper that authenticates all requests using HTTP Basic Authentication with the provided username and password.

func (*BasicAuthTransport) Client Uses

func (t *BasicAuthTransport) Client() *http.Client

Client returns an *http.Client that uses the BasicAuthTransport transport to authenticate the request via HTTP Basic Auth.

func (*BasicAuthTransport) RoundTrip Uses

func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface. We just add the basic auth and return the RoundTripper for this transport type.

type Certificate Uses

type Certificate struct {
    ID                  int64    `json:"id,omitempty"`
    DomainID            int64    `json:"domain_id,omitempty"`
    ContactID           int64    `json:"contact_id,omitempty"`
    CommonName          string   `json:"common_name,omitempty"`
    AlternateNames      []string `json:"alternate_names,omitempty"`
    Years               int      `json:"years,omitempty"`
    State               string   `json:"state,omitempty"`
    AuthorityIdentifier string   `json:"authority_identifier,omitempty"`
    AutoRenew           bool     `json:"auto_renew"`
    CreatedAt           string   `json:"created_at,omitempty"`
    UpdatedAt           string   `json:"updated_at,omitempty"`
    ExpiresAt           string   `json:"expires_at,omitempty"`
    CertificateRequest  string   `json:"csr,omitempty"`
}

Certificate represents a Certificate in DNSimple.

type CertificateBundle Uses

type CertificateBundle struct {
    // CertificateRequest       string   `json:"csr,omitempty"`
    PrivateKey               string   `json:"private_key,omitempty"`
    ServerCertificate        string   `json:"server,omitempty"`
    RootCertificate          string   `json:"root,omitempty"`
    IntermediateCertificates []string `json:"chain,omitempty"`
}

CertificateBundle represents a container for all the PEM-encoded X509 certificate entities, such as the private key, the server certificate and the intermediate chain.

type CertificateBundleResponse Uses

type CertificateBundleResponse struct {
    Response
    Data *CertificateBundle `json:"data"`
}

CertificateBundleResponse represents a response from an API method that returns a CertificatBundle struct.

type CertificatePurchase Uses

type CertificatePurchase struct {
    ID            int64  `json:"id,omitempty"`
    CertificateID int64  `json:"new_certificate_id,omitempty"`
    State         string `json:"state,omitempty"`
    AutoRenew     bool   `json:"auto_renew,omitempty"`
    CreatedAt     string `json:"created_at,omitempty"`
    UpdatedAt     string `json:"updated_at,omitempty"`
}

CertificatePurchase represents a Certificate Purchase in DNSimple.

type CertificatePurchaseResponse Uses

type CertificatePurchaseResponse struct {
    Response
    Data *CertificatePurchase `json:"data"`
}

CertificatePurchaseResponse represents a response from an API method that returns a CertificatePurchase struct.

type CertificateRenewal Uses

type CertificateRenewal struct {
    ID               int64  `json:"id,omitempty"`
    OldCertificateID int64  `json:"old_certificate_id,omitempty"`
    NewCertificateID int64  `json:"new_certificate_id,omitempty"`
    State            string `json:"state,omitempty"`
    AutoRenew        bool   `json:"auto_renew,omitempty"`
    CreatedAt        string `json:"created_at,omitempty"`
    UpdatedAt        string `json:"updated_at,omitempty"`
}

CertificateRenewal represents a Certificate Renewal in DNSimple.

type CertificateRenewalResponse Uses

type CertificateRenewalResponse struct {
    Response
    Data *CertificateRenewal `json:"data"`
}

CertificateRenewalResponse represents a response from an API method that returns a CertificateRenewal struct.

type CertificateResponse Uses

type CertificateResponse struct {
    Response
    Data *Certificate `json:"data"`
}

CertificateResponse represents a response from an API method that returns a Certificate struct.

type CertificatesResponse Uses

type CertificatesResponse struct {
    Response
    Data []Certificate `json:"data"`
}

CertificatesResponse represents a response from an API method that returns a collection of Certificate struct.

type CertificatesService Uses

type CertificatesService struct {
    // contains filtered or unexported fields
}

CertificatesService handles communication with the certificate related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/certificates/

func (*CertificatesService) DownloadCertificate Uses

func (s *CertificatesService) DownloadCertificate(ctx context.Context, accountID, domainIdentifier string, certificateID int64) (*CertificateBundleResponse, error)

DownloadCertificate gets the PEM-encoded certificate, along with the root certificate and intermediate chain.

See https://developer.dnsimple.com/v2/certificates#downloadCertificate

func (*CertificatesService) GetCertificate Uses

func (s *CertificatesService) GetCertificate(ctx context.Context, accountID, domainIdentifier string, certificateID int64) (*CertificateResponse, error)

GetCertificate gets the details of a certificate.

See https://developer.dnsimple.com/v2/certificates#getCertificate

func (*CertificatesService) GetCertificatePrivateKey Uses

func (s *CertificatesService) GetCertificatePrivateKey(ctx context.Context, accountID, domainIdentifier string, certificateID int64) (*CertificateBundleResponse, error)

GetCertificatePrivateKey gets the PEM-encoded certificate private key.

See https://developer.dnsimple.com/v2/certificates#getCertificatePrivateKey

func (*CertificatesService) IssueLetsencryptCertificate Uses

func (s *CertificatesService) IssueLetsencryptCertificate(ctx context.Context, accountID, domainIdentifier string, certificateID int64) (*CertificateResponse, error)

IssueLetsencryptCertificate issues a pending Let's Encrypt certificate purchase order.

See https://developer.dnsimple.com/v2/certificates/#issueLetsencryptCertificate

func (*CertificatesService) IssueLetsencryptCertificateRenewal Uses

func (s *CertificatesService) IssueLetsencryptCertificateRenewal(ctx context.Context, accountID, domainIdentifier string, certificateID, certificateRenewalID int64) (*CertificateResponse, error)

IssueLetsencryptCertificateRenewal issues a pending Let's Encrypt certificate renewal order.

See https://developer.dnsimple.com/v2/certificates/#issueRenewalLetsencryptCertificate

func (*CertificatesService) ListCertificates Uses

func (s *CertificatesService) ListCertificates(ctx context.Context, accountID, domainIdentifier string, options *ListOptions) (*CertificatesResponse, error)

ListCertificates lists the certificates for a domain in the account.

See https://developer.dnsimple.com/v2/certificates#listCertificates

func (*CertificatesService) PurchaseLetsencryptCertificate Uses

func (s *CertificatesService) PurchaseLetsencryptCertificate(ctx context.Context, accountID, domainIdentifier string, certificateAttributes LetsencryptCertificateAttributes) (*CertificatePurchaseResponse, error)

PurchaseLetsencryptCertificate purchases a Let's Encrypt certificate.

See https://developer.dnsimple.com/v2/certificates/#purchaseLetsencryptCertificate

func (*CertificatesService) PurchaseLetsencryptCertificateRenewal Uses

func (s *CertificatesService) PurchaseLetsencryptCertificateRenewal(ctx context.Context, accountID, domainIdentifier string, certificateID int64, certificateAttributes LetsencryptCertificateAttributes) (*CertificateRenewalResponse, error)

PurchaseLetsencryptCertificateRenewal purchases a Let's Encrypt certificate renewal.

See https://developer.dnsimple.com/v2/certificates/#purchaseRenewalLetsencryptCertificate

type Client Uses

type Client struct {

    // BaseURL for API requests.
    // Defaults to the public DNSimple API, but can be set to a different endpoint (e.g. the sandbox).
    BaseURL string

    // UserAgent used when communicating with the DNSimple API.
    UserAgent string

    // Services used for talking to different parts of the DNSimple API.
    Identity          *IdentityService
    Accounts          *AccountsService
    Certificates      *CertificatesService
    Contacts          *ContactsService
    Domains           *DomainsService
    Oauth             *OauthService
    Registrar         *RegistrarService
    Services          *ServicesService
    Templates         *TemplatesService
    Tlds              *TldsService
    VanityNameServers *VanityNameServersService
    Webhooks          *WebhooksService
    Zones             *ZonesService

    // Set to true to output debugging logs during API calls
    Debug bool
    // contains filtered or unexported fields
}

Client represents a client to the DNSimple API.

func NewClient Uses

func NewClient(httpClient *http.Client) *Client

NewClient returns a new DNSimple API client.

To authenticate you must provide an http.Client that will perform authentication for you with one of the currently supported mechanisms: OAuth or HTTP Basic.

func (*Client) Request Uses

func (c *Client) Request(ctx context.Context, method, path string, payload, obj interface{}, headers http.Header) (*http.Response, error)

Request executes an API request with the current client scope, and returns the response.

func (*Client) SetUserAgent Uses

func (c *Client) SetUserAgent(ua string)

SetUserAgent overrides the default UserAgent.

When a custom user agent is provided, the final user agent is the combination of the custom user agent prepended by the default user agent.

customAgentFlag dnsimple-go/1.0

type Collaborator Uses

type Collaborator struct {
    ID         int64  `json:"id,omitempty"`
    DomainID   int64  `json:"domain_id,omitempty"`
    DomainName string `json:"domain_name,omitempty"`
    UserID     int64  `json:"user_id,omitempty"`
    UserEmail  string `json:"user_email,omitempty"`
    Invitation bool   `json:"invitation,omitempty"`
    CreatedAt  string `json:"created_at,omitempty"`
    UpdatedAt  string `json:"updated_at,omitempty"`
    AcceptedAt string `json:"accepted_at,omitempty"`
}

Collaborator represents a Collaborator in DNSimple.

type CollaboratorAttributes Uses

type CollaboratorAttributes struct {
    Email string `json:"email,omitempty"`
}

CollaboratorAttributes represents Collaborator attributes for AddCollaborator operation.

type CollaboratorResponse Uses

type CollaboratorResponse struct {
    Response
    Data *Collaborator `json:"data"`
}

CollaboratorResponse represents a response from an API method that returns a Collaborator struct.

type CollaboratorsResponse Uses

type CollaboratorsResponse struct {
    Response
    Data []Collaborator `json:"data"`
}

CollaboratorsResponse represents a response from an API method that returns a collection of Collaborator struct.

type Contact Uses

type Contact struct {
    ID            int64  `json:"id,omitempty"`
    AccountID     int64  `json:"account_id,omitempty"`
    Label         string `json:"label,omitempty"`
    FirstName     string `json:"first_name,omitempty"`
    LastName      string `json:"last_name,omitempty"`
    JobTitle      string `json:"job_title,omitempty"`
    Organization  string `json:"organization_name,omitempty"`
    Address1      string `json:"address1,omitempty"`
    Address2      string `json:"address2,omitempty"`
    City          string `json:"city,omitempty"`
    StateProvince string `json:"state_province,omitempty"`
    PostalCode    string `json:"postal_code,omitempty"`
    Country       string `json:"country,omitempty"`
    Phone         string `json:"phone,omitempty"`
    Fax           string `json:"fax,omitempty"`
    Email         string `json:"email,omitempty"`
    CreatedAt     string `json:"created_at,omitempty"`
    UpdatedAt     string `json:"updated_at,omitempty"`
}

Contact represents a Contact in DNSimple.

type ContactResponse Uses

type ContactResponse struct {
    Response
    Data *Contact `json:"data"`
}

ContactResponse represents a response from an API method that returns a Contact struct.

type ContactsResponse Uses

type ContactsResponse struct {
    Response
    Data []Contact `json:"data"`
}

ContactsResponse represents a response from an API method that returns a collection of Contact struct.

type ContactsService Uses

type ContactsService struct {
    // contains filtered or unexported fields
}

ContactsService handles communication with the contact related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/contacts/

func (*ContactsService) CreateContact Uses

func (s *ContactsService) CreateContact(ctx context.Context, accountID string, contactAttributes Contact) (*ContactResponse, error)

CreateContact creates a new contact.

See https://developer.dnsimple.com/v2/contacts/#create

func (*ContactsService) DeleteContact Uses

func (s *ContactsService) DeleteContact(ctx context.Context, accountID string, contactID int64) (*ContactResponse, error)

DeleteContact PERMANENTLY deletes a contact from the account.

See https://developer.dnsimple.com/v2/contacts/#delete

func (*ContactsService) GetContact Uses

func (s *ContactsService) GetContact(ctx context.Context, accountID string, contactID int64) (*ContactResponse, error)

GetContact fetches a contact.

See https://developer.dnsimple.com/v2/contacts/#get

func (*ContactsService) ListContacts Uses

func (s *ContactsService) ListContacts(ctx context.Context, accountID string, options *ListOptions) (*ContactsResponse, error)

ListContacts list the contacts for an account.

See https://developer.dnsimple.com/v2/contacts/#list

func (*ContactsService) UpdateContact Uses

func (s *ContactsService) UpdateContact(ctx context.Context, accountID string, contactID int64, contactAttributes Contact) (*ContactResponse, error)

UpdateContact updates a contact.

See https://developer.dnsimple.com/v2/contacts/#update

type Delegation Uses

type Delegation []string

Delegation represents a list of name servers that correspond to a domain delegation.

type DelegationResponse Uses

type DelegationResponse struct {
    Response
    Data *Delegation `json:"data"`
}

DelegationResponse represents a response from an API method that returns a delegation struct.

type DelegationSignerRecord Uses

type DelegationSignerRecord struct {
    ID         int64  `json:"id,omitempty"`
    DomainID   int64  `json:"domain_id,omitempty"`
    Algorithm  string `json:"algorithm"`
    Digest     string `json:"digest"`
    DigestType string `json:"digest_type"`
    Keytag     string `json:"keytag"`
    CreatedAt  string `json:"created_at,omitempty"`
    UpdatedAt  string `json:"updated_at,omitempty"`
}

DelegationSignerRecord represents a delegation signer record for a domain in DNSimple.

type DelegationSignerRecordResponse Uses

type DelegationSignerRecordResponse struct {
    Response
    Data *DelegationSignerRecord `json:"data"`
}

DelegationSignerRecordResponse represents a response from an API method that returns a DelegationSignerRecord struct.

type DelegationSignerRecordsResponse Uses

type DelegationSignerRecordsResponse struct {
    Response
    Data []DelegationSignerRecord `json:"data"`
}

DelegationSignerRecordsResponse represents a response from an API method that returns a DelegationSignerRecord struct.

type Dnssec Uses

type Dnssec struct {
    Enabled bool `json:"enabled"`
}

Dnssec represents the current DNSSEC settings for a domain in DNSimple.

type DnssecResponse Uses

type DnssecResponse struct {
    Response
    Data *Dnssec `json:"data"`
}

DnssecResponse represents a response from an API method that returns a Dnssec struct.

type Domain Uses

type Domain struct {
    ID           int64  `json:"id,omitempty"`
    AccountID    int64  `json:"account_id,omitempty"`
    RegistrantID int64  `json:"registrant_id,omitempty"`
    Name         string `json:"name,omitempty"`
    UnicodeName  string `json:"unicode_name,omitempty"`
    Token        string `json:"token,omitempty"`
    State        string `json:"state,omitempty"`
    AutoRenew    bool   `json:"auto_renew,omitempty"`
    PrivateWhois bool   `json:"private_whois,omitempty"`
    ExpiresAt    string `json:"expires_at,omitempty"`
    CreatedAt    string `json:"created_at,omitempty"`
    UpdatedAt    string `json:"updated_at,omitempty"`
}

Domain represents a domain in DNSimple.

type DomainCheck Uses

type DomainCheck struct {
    Domain    string `json:"domain"`
    Available bool   `json:"available"`
    Premium   bool   `json:"premium"`
}

DomainCheck represents the result of a domain check.

type DomainCheckResponse Uses

type DomainCheckResponse struct {
    Response
    Data *DomainCheck `json:"data"`
}

DomainCheckResponse represents a response from a domain check request.

type DomainListOptions Uses

type DomainListOptions struct {
    // Select domains where the name contains given string.
    NameLike *string `url:"name_like,omitempty"`

    // Select domains where the registrant matches given ID.
    RegistrantID *int `url:"registrant_id,omitempty"`

    ListOptions
}

DomainListOptions specifies the optional parameters you can provide to customize the DomainsService.ListDomains method.

type DomainPremiumPrice Uses

type DomainPremiumPrice struct {
    // The domain premium price
    PremiumPrice string `json:"premium_price"`
    // The registrar action.
    // Possible values are registration|transfer|renewal
    Action string `json:"action"`
}

DomainPremiumPrice represents the premium price for a premium domain.

type DomainPremiumPriceOptions Uses

type DomainPremiumPriceOptions struct {
    Action string `url:"action,omitempty"`
}

DomainPremiumPriceOptions specifies the optional parameters you can provide to customize the RegistrarService.GetDomainPremiumPrice method.

type DomainPremiumPriceResponse Uses

type DomainPremiumPriceResponse struct {
    Response
    Data *DomainPremiumPrice `json:"data"`
}

DomainPremiumPriceResponse represents a response from a domain premium price request.

type DomainPush Uses

type DomainPush struct {
    ID         int64  `json:"id,omitempty"`
    DomainID   int64  `json:"domain_id,omitempty"`
    ContactID  int64  `json:"contact_id,omitempty"`
    AccountID  int64  `json:"account_id,omitempty"`
    CreatedAt  string `json:"created_at,omitempty"`
    UpdatedAt  string `json:"updated_at,omitempty"`
    AcceptedAt string `json:"accepted_at,omitempty"`
}

DomainPush represents a domain push in DNSimple.

type DomainPushAttributes Uses

type DomainPushAttributes struct {
    NewAccountEmail string `json:"new_account_email,omitempty"`
    ContactID       int64  `json:"contact_id,omitempty"`
}

DomainPushAttributes represent a domain push payload (see initiate).

type DomainPushResponse Uses

type DomainPushResponse struct {
    Response
    Data *DomainPush `json:"data"`
}

DomainPushResponse represents a response from an API method that returns a DomainPush struct.

type DomainPushesResponse Uses

type DomainPushesResponse struct {
    Response
    Data []DomainPush `json:"data"`
}

DomainPushesResponse represents a response from an API method that returns a collection of DomainPush struct.

type DomainRegistration Uses

type DomainRegistration struct {
    ID           int64  `json:"id"`
    DomainID     int64  `json:"domain_id"`
    RegistrantID int64  `json:"registrant_id"`
    Period       int    `json:"period"`
    State        string `json:"state"`
    AutoRenew    bool   `json:"auto_renew"`
    WhoisPrivacy bool   `json:"whois_privacy"`
    CreatedAt    string `json:"created_at,omitempty"`
    UpdatedAt    string `json:"updated_at,omitempty"`
}

DomainRegistration represents the result of a domain renewal call.

type DomainRegistrationResponse Uses

type DomainRegistrationResponse struct {
    Response
    Data *DomainRegistration `json:"data"`
}

DomainRegistrationResponse represents a response from an API method that results in a domain registration.

type DomainRenewal Uses

type DomainRenewal struct {
    ID        int64  `json:"id"`
    DomainID  int64  `json:"domain_id"`
    Period    int    `json:"period"`
    State     string `json:"state"`
    CreatedAt string `json:"created_at,omitempty"`
    UpdatedAt string `json:"updated_at,omitempty"`
}

DomainRenewal represents the result of a domain renewal call.

type DomainRenewalResponse Uses

type DomainRenewalResponse struct {
    Response
    Data *DomainRenewal `json:"data"`
}

DomainRenewalResponse represents a response from an API method that returns a domain renewal.

type DomainResponse Uses

type DomainResponse struct {
    Response
    Data *Domain `json:"data"`
}

DomainResponse represents a response from an API method that returns a Domain struct.

type DomainServiceSettings Uses

type DomainServiceSettings struct {
    Settings map[string]string `url:"settings,omitempty"`
}

DomainServiceSettings represents optional settings when applying a DNSimple one-click service to a domain.

type DomainTransfer Uses

type DomainTransfer struct {
    ID                int64  `json:"id"`
    DomainID          int64  `json:"domain_id"`
    RegistrantID      int64  `json:"registrant_id"`
    State             string `json:"state"`
    AutoRenew         bool   `json:"auto_renew"`
    WhoisPrivacy      bool   `json:"whois_privacy"`
    StatusDescription string `json:"status_description"`
    CreatedAt         string `json:"created_at,omitempty"`
    UpdatedAt         string `json:"updated_at,omitempty"`
}

DomainTransfer represents the result of a domain renewal call.

type DomainTransferOutResponse Uses

type DomainTransferOutResponse struct {
    Response
    Data *Domain `json:"data"`
}

DomainTransferOutResponse represents a response from an API method that results in a domain transfer out.

type DomainTransferResponse Uses

type DomainTransferResponse struct {
    Response
    Data *DomainTransfer `json:"data"`
}

DomainTransferResponse represents a response from an API method that results in a domain transfer.

type DomainsResponse Uses

type DomainsResponse struct {
    Response
    Data []Domain `json:"data"`
}

DomainsResponse represents a response from an API method that returns a collection of Domain struct.

type DomainsService Uses

type DomainsService struct {
    // contains filtered or unexported fields
}

DomainsService handles communication with the domain related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/domains/

func (*DomainsService) AcceptPush Uses

func (s *DomainsService) AcceptPush(ctx context.Context, accountID string, pushID int64, pushAttributes DomainPushAttributes) (*DomainPushResponse, error)

AcceptPush accept a push for a domain.

See https://developer.dnsimple.com/v2/domains/pushes/#acceptPush

func (*DomainsService) AddCollaborator Uses

func (s *DomainsService) AddCollaborator(ctx context.Context, accountID string, domainIdentifier string, attributes CollaboratorAttributes) (*CollaboratorResponse, error)

AddCollaborator adds a new collaborator to the domain in the account.

See https://developer.dnsimple.com/v2/domains/collaborators#add

func (*DomainsService) CreateDelegationSignerRecord Uses

func (s *DomainsService) CreateDelegationSignerRecord(ctx context.Context, accountID string, domainIdentifier string, dsRecordAttributes DelegationSignerRecord) (*DelegationSignerRecordResponse, error)

CreateDelegationSignerRecord creates a new delegation signer record.

See https://developer.dnsimple.com/v2/domains/dnssec/#ds-record-create

func (*DomainsService) CreateDomain Uses

func (s *DomainsService) CreateDomain(ctx context.Context, accountID string, domainAttributes Domain) (*DomainResponse, error)

CreateDomain creates a new domain in the account.

See https://developer.dnsimple.com/v2/domains/#create

func (*DomainsService) CreateEmailForward Uses

func (s *DomainsService) CreateEmailForward(ctx context.Context, accountID string, domainIdentifier string, forwardAttributes EmailForward) (*EmailForwardResponse, error)

CreateEmailForward creates a new email forward.

See https://developer.dnsimple.com/v2/domains/email-forwards/#create

func (*DomainsService) DeleteDelegationSignerRecord Uses

func (s *DomainsService) DeleteDelegationSignerRecord(ctx context.Context, accountID string, domainIdentifier string, dsRecordID int64) (*DelegationSignerRecordResponse, error)

DeleteDelegationSignerRecord PERMANENTLY deletes a delegation signer record from the domain.

See https://developer.dnsimple.com/v2/domains/dnssec/#ds-record-delete

func (*DomainsService) DeleteDomain Uses

func (s *DomainsService) DeleteDomain(ctx context.Context, accountID string, domainIdentifier string) (*DomainResponse, error)

DeleteDomain PERMANENTLY deletes a domain from the account.

See https://developer.dnsimple.com/v2/domains/#delete

func (*DomainsService) DeleteEmailForward Uses

func (s *DomainsService) DeleteEmailForward(ctx context.Context, accountID string, domainIdentifier string, forwardID int64) (*EmailForwardResponse, error)

DeleteEmailForward PERMANENTLY deletes an email forward from the domain.

See https://developer.dnsimple.com/v2/domains/email-forwards/#delete

func (*DomainsService) DisableDnssec Uses

func (s *DomainsService) DisableDnssec(ctx context.Context, accountID string, domainIdentifier string) (*DnssecResponse, error)

DisableDnssec disables DNSSEC on the domain.

See https://developer.dnsimple.com/v2/domains/dnssec/#disableDomainDnssec

func (*DomainsService) EnableDnssec Uses

func (s *DomainsService) EnableDnssec(ctx context.Context, accountID string, domainIdentifier string) (*DnssecResponse, error)

EnableDnssec enables DNSSEC on the domain.

See https://developer.dnsimple.com/v2/domains/dnssec/#enableDomainDnssec

func (*DomainsService) GetDelegationSignerRecord Uses

func (s *DomainsService) GetDelegationSignerRecord(ctx context.Context, accountID string, domainIdentifier string, dsRecordID int64) (*DelegationSignerRecordResponse, error)

GetDelegationSignerRecord fetches a delegation signer record.

See https://developer.dnsimple.com/v2/domains/dnssec/#ds-record-get

func (*DomainsService) GetDnssec Uses

func (s *DomainsService) GetDnssec(ctx context.Context, accountID string, domainIdentifier string) (*DnssecResponse, error)

GetDnssec retrieves the current status of DNSSEC on the domain.

See https://developer.dnsimple.com/v2/domains/dnssec/#getDomainDnssec

func (*DomainsService) GetDomain Uses

func (s *DomainsService) GetDomain(ctx context.Context, accountID string, domainIdentifier string) (*DomainResponse, error)

GetDomain fetches a domain.

See https://developer.dnsimple.com/v2/domains/#get

func (*DomainsService) GetEmailForward Uses

func (s *DomainsService) GetEmailForward(ctx context.Context, accountID string, domainIdentifier string, forwardID int64) (*EmailForwardResponse, error)

GetEmailForward fetches an email forward.

See https://developer.dnsimple.com/v2/domains/email-forwards/#get

func (*DomainsService) InitiatePush Uses

func (s *DomainsService) InitiatePush(ctx context.Context, accountID, domainID string, pushAttributes DomainPushAttributes) (*DomainPushResponse, error)

InitiatePush initiate a new domain push.

See https://developer.dnsimple.com/v2/domains/pushes/#initiateDomainPush

func (*DomainsService) ListCollaborators Uses

func (s *DomainsService) ListCollaborators(ctx context.Context, accountID, domainIdentifier string, options *ListOptions) (*CollaboratorsResponse, error)

ListCollaborators list the collaborators for a domain.

See https://developer.dnsimple.com/v2/domains/collaborators#list

func (*DomainsService) ListDelegationSignerRecords Uses

func (s *DomainsService) ListDelegationSignerRecords(ctx context.Context, accountID string, domainIdentifier string, options *ListOptions) (*DelegationSignerRecordsResponse, error)

ListDelegationSignerRecords lists the delegation signer records for a domain.

See https://developer.dnsimple.com/v2/domains/dnssec/#ds-record-list

func (*DomainsService) ListDomains Uses

func (s *DomainsService) ListDomains(ctx context.Context, accountID string, options *DomainListOptions) (*DomainsResponse, error)

ListDomains lists the domains for an account.

See https://developer.dnsimple.com/v2/domains/#list

func (*DomainsService) ListEmailForwards Uses

func (s *DomainsService) ListEmailForwards(ctx context.Context, accountID string, domainIdentifier string, options *ListOptions) (*EmailForwardsResponse, error)

ListEmailForwards lists the email forwards for a domain.

See https://developer.dnsimple.com/v2/domains/email-forwards/#list

func (*DomainsService) ListPushes Uses

func (s *DomainsService) ListPushes(ctx context.Context, accountID string, options *ListOptions) (*DomainPushesResponse, error)

ListPushes lists the pushes for an account.

See https://developer.dnsimple.com/v2/domains/pushes/#listPushes

func (*DomainsService) RejectPush Uses

func (s *DomainsService) RejectPush(ctx context.Context, accountID string, pushID int64) (*DomainPushResponse, error)

RejectPush reject a push for a domain.

See https://developer.dnsimple.com/v2/domains/pushes/#rejectPush

func (*DomainsService) RemoveCollaborator Uses

func (s *DomainsService) RemoveCollaborator(ctx context.Context, accountID string, domainIdentifier string, collaboratorID int64) (*CollaboratorResponse, error)

RemoveCollaborator PERMANENTLY deletes a domain from the account.

See https://developer.dnsimple.com/v2/domains/collaborators#remove

type EmailForward Uses

type EmailForward struct {
    ID        int64  `json:"id,omitempty"`
    DomainID  int64  `json:"domain_id,omitempty"`
    From      string `json:"from,omitempty"`
    To        string `json:"to,omitempty"`
    CreatedAt string `json:"created_at,omitempty"`
    UpdatedAt string `json:"updated_at,omitempty"`
}

EmailForward represents an email forward in DNSimple.

type EmailForwardResponse Uses

type EmailForwardResponse struct {
    Response
    Data *EmailForward `json:"data"`
}

EmailForwardResponse represents a response from an API method that returns an EmailForward struct.

type EmailForwardsResponse Uses

type EmailForwardsResponse struct {
    Response
    Data []EmailForward `json:"data"`
}

EmailForwardsResponse represents a response from an API method that returns a collection of EmailForward struct.

type ErrorResponse Uses

type ErrorResponse struct {
    Response

    // human-readable message
    Message string `json:"message"`
}

An ErrorResponse represents an API response that generated an error.

func (*ErrorResponse) Error Uses

func (r *ErrorResponse) Error() string

Error implements the error interface.

type ExchangeAuthorizationError Uses

type ExchangeAuthorizationError struct {
    // HTTP response
    HTTPResponse *http.Response

    ErrorCode        string `json:"error"`
    ErrorDescription string `json:"error_description"`
}

ExchangeAuthorizationError represents a failed request to exchange an authorization code for an access token.

func (*ExchangeAuthorizationError) Error Uses

func (r *ExchangeAuthorizationError) Error() string

Error implements the error interface.

type ExchangeAuthorizationRequest Uses

type ExchangeAuthorizationRequest struct {
    Code         string    `json:"code"`
    ClientID     string    `json:"client_id"`
    ClientSecret string    `json:"client_secret"`
    RedirectURI  string    `json:"redirect_uri,omitempty"`
    State        string    `json:"state,omitempty"`
    GrantType    GrantType `json:"grant_type,omitempty"`
}

ExchangeAuthorizationRequest represents a request to exchange an authorization code for an access token. RedirectURI is optional, all the other fields are mandatory.

type GrantType Uses

type GrantType string

GrantType is a string that identifies a particular grant type in the exchange request.

type IdentityService Uses

type IdentityService struct {
    // contains filtered or unexported fields
}

IdentityService handles communication with several authentication identity methods of the DNSimple API.

See https://developer.dnsimple.com/v2/identity/

func (*IdentityService) Whoami Uses

func (s *IdentityService) Whoami(ctx context.Context) (*WhoamiResponse, error)

Whoami gets the current authenticate context.

See https://developer.dnsimple.com/v2/whoami

type LetsencryptCertificateAttributes Uses

type LetsencryptCertificateAttributes struct {
    ContactID      int64    `json:"contact_id,omitempty"`
    Name           string   `json:"name,omitempty"`
    AutoRenew      bool     `json:"auto_renew,omitempty"`
    AlternateNames []string `json:"alternate_names,omitempty"`
}

LetsencryptCertificateAttributes is a set of attributes to purchase a Let's Encrypt certificate.

type ListOptions Uses

type ListOptions struct {
    // The page to return
    Page *int `url:"page,omitempty"`

    // The number of entries to return per page
    PerPage *int `url:"per_page,omitempty"`

    // The order criteria to sort the results.
    // The value is a comma-separated list of field[:direction],
    // eg. name | name:desc | name:desc,expiration:desc
    Sort *string `url:"sort,omitempty"`
}

ListOptions contains the common options you can pass to a List method in order to control parameters such as pagination and page number.

type OauthService Uses

type OauthService struct {
    // contains filtered or unexported fields
}

OauthService handles communication with the authorization related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/oauth/

func (*OauthService) AuthorizeURL Uses

func (s *OauthService) AuthorizeURL(clientID string, options *AuthorizationOptions) string

AuthorizeURL generates the URL to authorize an user for an application via the OAuth2 flow.

func (*OauthService) ExchangeAuthorizationForToken Uses

func (s *OauthService) ExchangeAuthorizationForToken(authorization *ExchangeAuthorizationRequest) (*AccessToken, error)

ExchangeAuthorizationForToken exchanges the short-lived authorization code for an access token you can use to authenticate your API calls.

type Pagination Uses

type Pagination struct {
    CurrentPage  int `json:"current_page"`
    PerPage      int `json:"per_page"`
    TotalPages   int `json:"total_pages"`
    TotalEntries int `json:"total_entries"`
}

Pagination represents the pagination information, if the response is paginated.

type RegisterDomainInput Uses

type RegisterDomainInput struct {
    // The ID of the Contact to use as registrant for the domain
    RegistrantID int `json:"registrant_id"`
    // Set to true to enable the whois privacy service. An extra cost may apply.
    // Default to false.
    EnableWhoisPrivacy bool `json:"whois_privacy,omitempty"`
    // Set to true to enable the auto-renewal of the domain.
    // Default to true.
    EnableAutoRenewal bool `json:"auto_renew,omitempty"`
    // Required by some TLDs. Use Tlds.GetTldExtendedAttributes() to get the required entries.
    ExtendedAttributes map[string]string `json:"extended_attributes,omitempty"`
    // Required as confirmation of the price, only if the domain is premium.
    PremiumPrice string `json:"premium_price,omitempty"`
}

RegisterDomainInput represents the attributes you can pass to a register API request. Some attributes are mandatory.

type RegistrarService Uses

type RegistrarService struct {
    // contains filtered or unexported fields
}

RegistrarService handles communication with the registrar related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/registrar/

func (*RegistrarService) CancelDomainTransfer Uses

func (s *RegistrarService) CancelDomainTransfer(ctx context.Context, accountID string, domainName string, domainTransferID int64) (*DomainTransferResponse, error)

CancelDomainTransfer cancels an in progress domain transfer.

See https://developer.dnsimple.com/v2/registrar/#cancelDomainTransfer

func (*RegistrarService) ChangeDomainDelegation Uses

func (s *RegistrarService) ChangeDomainDelegation(ctx context.Context, accountID string, domainName string, newDelegation *Delegation) (*DelegationResponse, error)

ChangeDomainDelegation updates the delegated name severs for the domain.

See https://developer.dnsimple.com/v2/registrar/delegation/#get

func (*RegistrarService) ChangeDomainDelegationFromVanity Uses

func (s *RegistrarService) ChangeDomainDelegationFromVanity(ctx context.Context, accountID string, domainName string) (*VanityDelegationResponse, error)

ChangeDomainDelegationFromVanity disables vanity name servers for the given domain.

See https://developer.dnsimple.com/v2/registrar/delegation/#dedelegateFromVanity

func (*RegistrarService) ChangeDomainDelegationToVanity Uses

func (s *RegistrarService) ChangeDomainDelegationToVanity(ctx context.Context, accountID string, domainName string, newDelegation *Delegation) (*VanityDelegationResponse, error)

ChangeDomainDelegationToVanity enables vanity name servers for the given domain.

See https://developer.dnsimple.com/v2/registrar/delegation/#delegateToVanity

func (*RegistrarService) CheckDomain Uses

func (s *RegistrarService) CheckDomain(ctx context.Context, accountID string, domainName string) (*DomainCheckResponse, error)

CheckDomain checks a domain name.

See https://developer.dnsimple.com/v2/registrar/#check

func (*RegistrarService) DisableDomainAutoRenewal Uses

func (s *RegistrarService) DisableDomainAutoRenewal(ctx context.Context, accountID string, domainName string) (*DomainResponse, error)

DisableDomainAutoRenewal disables auto-renewal for the domain.

See https://developer.dnsimple.com/v2/registrar/auto-renewal/#enable

func (*RegistrarService) DisableWhoisPrivacy Uses

func (s *RegistrarService) DisableWhoisPrivacy(ctx context.Context, accountID string, domainName string) (*WhoisPrivacyResponse, error)

DisableWhoisPrivacy disables the whois privacy for the domain.

See https://developer.dnsimple.com/v2/registrar/whois-privacy/#enable

func (*RegistrarService) EnableDomainAutoRenewal Uses

func (s *RegistrarService) EnableDomainAutoRenewal(ctx context.Context, accountID string, domainName string) (*DomainResponse, error)

EnableDomainAutoRenewal enables auto-renewal for the domain.

See https://developer.dnsimple.com/v2/registrar/auto-renewal/#enable

func (*RegistrarService) EnableWhoisPrivacy Uses

func (s *RegistrarService) EnableWhoisPrivacy(ctx context.Context, accountID string, domainName string) (*WhoisPrivacyResponse, error)

EnableWhoisPrivacy enables the whois privacy for the domain.

See https://developer.dnsimple.com/v2/registrar/whois-privacy/#enable

func (*RegistrarService) GetDomainDelegation Uses

func (s *RegistrarService) GetDomainDelegation(ctx context.Context, accountID string, domainName string) (*DelegationResponse, error)

GetDomainDelegation gets the current delegated name servers for the domain.

See https://developer.dnsimple.com/v2/registrar/delegation/#get

func (*RegistrarService) GetDomainPremiumPrice Uses

func (s *RegistrarService) GetDomainPremiumPrice(ctx context.Context, accountID string, domainName string, options *DomainPremiumPriceOptions) (*DomainPremiumPriceResponse, error)

GetDomainPremiumPrice gets the premium price for a domain.

You must specify an action to get the price for. Valid actions are: - registration - transfer - renewal

See https://developer.dnsimple.com/v2/registrar/#premium-price

func (*RegistrarService) GetDomainTransfer Uses

func (s *RegistrarService) GetDomainTransfer(ctx context.Context, accountID string, domainName string, domainTransferID int64) (*DomainTransferResponse, error)

GetDomainTransfer fetches a domain transfer.

See https://developer.dnsimple.com/v2/registrar/#getDomainTransfer

func (*RegistrarService) GetWhoisPrivacy Uses

func (s *RegistrarService) GetWhoisPrivacy(ctx context.Context, accountID string, domainName string) (*WhoisPrivacyResponse, error)

GetWhoisPrivacy gets the whois privacy for the domain.

See https://developer.dnsimple.com/v2/registrar/whois-privacy/#get

func (*RegistrarService) RegisterDomain Uses

func (s *RegistrarService) RegisterDomain(ctx context.Context, accountID string, domainName string, input *RegisterDomainInput) (*DomainRegistrationResponse, error)

RegisterDomain registers a domain name.

See https://developer.dnsimple.com/v2/registrar/#register

func (*RegistrarService) RenewDomain Uses

func (s *RegistrarService) RenewDomain(ctx context.Context, accountID string, domainName string, input *RenewDomainInput) (*DomainRenewalResponse, error)

RenewDomain renews a domain name.

See https://developer.dnsimple.com/v2/registrar/#register

func (*RegistrarService) RenewWhoisPrivacy Uses

func (s *RegistrarService) RenewWhoisPrivacy(ctx context.Context, accountID string, domainName string) (*WhoisPrivacyRenewalResponse, error)

RenewWhoisPrivacy renews the whois privacy for the domain.

See https://developer.dnsimple.com/v2/registrar/whois-privacy/#renew

func (*RegistrarService) TransferDomain Uses

func (s *RegistrarService) TransferDomain(ctx context.Context, accountID string, domainName string, input *TransferDomainInput) (*DomainTransferResponse, error)

TransferDomain transfers a domain name.

See https://developer.dnsimple.com/v2/registrar/#transferDomain

func (*RegistrarService) TransferDomainOut Uses

func (s *RegistrarService) TransferDomainOut(ctx context.Context, accountID string, domainName string) (*DomainTransferOutResponse, error)

TransferDomainOut prepares a domain for outbound transfer.

See https://developer.dnsimple.com/v2/registrar/#authorizeDomainTransferOut

type RenewDomainInput Uses

type RenewDomainInput struct {
    // The number of years
    Period int `json:"period"`
    // Required as confirmation of the price, only if the domain is premium.
    PremiumPrice string `json:"premium_price,omitempty"`
}

RenewDomainInput represents the attributes you can pass to a renew API request. Some attributes are mandatory.

type Response Uses

type Response struct {
    // HTTP response
    HTTPResponse *http.Response

    // If the response is paginated, the Pagination will store them.
    Pagination *Pagination `json:"pagination"`
}

A Response represents an API response.

func (*Response) RateLimit Uses

func (r *Response) RateLimit() int

RateLimit returns the maximum amount of requests this account can send in an hour.

func (*Response) RateLimitRemaining Uses

func (r *Response) RateLimitRemaining() int

RateLimitRemaining returns the remaining amount of requests this account can send within this hour window.

func (*Response) RateLimitReset Uses

func (r *Response) RateLimitReset() time.Time

RateLimitReset returns when the throttling window will be reset for this account.

type Service Uses

type Service struct {
    ID               int64            `json:"id,omitempty"`
    SID              string           `json:"sid,omitempty"`
    Name             string           `json:"name,omitempty"`
    Description      string           `json:"description,omitempty"`
    SetupDescription string           `json:"setup_description,omitempty"`
    RequiresSetup    bool             `json:"requires_setup,omitempty"`
    DefaultSubdomain string           `json:"default_subdomain,omitempty"`
    CreatedAt        string           `json:"created_at,omitempty"`
    UpdatedAt        string           `json:"updated_at,omitempty"`
    Settings         []ServiceSetting `json:"settings,omitempty"`
}

Service represents a Service in DNSimple.

type ServiceResponse Uses

type ServiceResponse struct {
    Response
    Data *Service `json:"data"`
}

ServiceResponse represents a response from an API method that returns a Service struct.

type ServiceSetting Uses

type ServiceSetting struct {
    Name        string `json:"name,omitempty"`
    Label       string `json:"label,omitempty"`
    Append      string `json:"append,omitempty"`
    Description string `json:"description,omitempty"`
    Example     string `json:"example,omitempty"`
    Password    bool   `json:"password,omitempty"`
}

ServiceSetting represents a single group of settings for a DNSimple Service.

type ServicesResponse Uses

type ServicesResponse struct {
    Response
    Data []Service `json:"data"`
}

ServicesResponse represents a response from an API method that returns a collection of Service struct.

type ServicesService Uses

type ServicesService struct {
    // contains filtered or unexported fields
}

ServicesService handles communication with the service related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/services/

func (*ServicesService) AppliedServices Uses

func (s *ServicesService) AppliedServices(ctx context.Context, accountID string, domainIdentifier string, options *ListOptions) (*ServicesResponse, error)

AppliedServices lists the applied one-click services for a domain.

See https://developer.dnsimple.com/v2/services/domains/#applied

func (*ServicesService) ApplyService Uses

func (s *ServicesService) ApplyService(ctx context.Context, accountID string, serviceIdentifier string, domainIdentifier string, settings DomainServiceSettings) (*ServiceResponse, error)

ApplyService applies a one-click services to a domain.

See https://developer.dnsimple.com/v2/services/domains/#apply

func (*ServicesService) GetService Uses

func (s *ServicesService) GetService(ctx context.Context, serviceIdentifier string) (*ServiceResponse, error)

GetService fetches a one-click service.

See https://developer.dnsimple.com/v2/services/#get

func (*ServicesService) ListServices Uses

func (s *ServicesService) ListServices(ctx context.Context, options *ListOptions) (*ServicesResponse, error)

ListServices lists the one-click services available in DNSimple.

See https://developer.dnsimple.com/v2/services/#list

func (*ServicesService) UnapplyService Uses

func (s *ServicesService) UnapplyService(ctx context.Context, accountID string, serviceIdentifier string, domainIdentifier string) (*ServiceResponse, error)

UnapplyService unapplies a one-click services from a domain.

See https://developer.dnsimple.com/v2/services/domains/#unapply

type Template Uses

type Template struct {
    ID          int64  `json:"id,omitempty"`
    SID         string `json:"sid,omitempty"`
    AccountID   int64  `json:"account_id,omitempty"`
    Name        string `json:"name,omitempty"`
    Description string `json:"description,omitempty"`
    CreatedAt   string `json:"created_at,omitempty"`
    UpdatedAt   string `json:"updated_at,omitempty"`
}

Template represents a Template in DNSimple.

type TemplateRecord Uses

type TemplateRecord struct {
    ID         int64  `json:"id,omitempty"`
    TemplateID int64  `json:"template_id,omitempty"`
    Name       string `json:"name"`
    Content    string `json:"content,omitempty"`
    TTL        int    `json:"ttl,omitempty"`
    Type       string `json:"type,omitempty"`
    Priority   int    `json:"priority,omitempty"`
    CreatedAt  string `json:"created_at,omitempty"`
    UpdatedAt  string `json:"updated_at,omitempty"`
}

TemplateRecord represents a DNS record for a template in DNSimple.

type TemplateRecordResponse Uses

type TemplateRecordResponse struct {
    Response
    Data *TemplateRecord `json:"data"`
}

TemplateRecordResponse represents a response from an API method that returns a TemplateRecord struct.

type TemplateRecordsResponse Uses

type TemplateRecordsResponse struct {
    Response
    Data []TemplateRecord `json:"data"`
}

TemplateRecordsResponse represents a response from an API method that returns a collection of TemplateRecord struct.

type TemplateResponse Uses

type TemplateResponse struct {
    Response
    Data *Template `json:"data"`
}

TemplateResponse represents a response from an API method that returns a Template struct.

type TemplatesResponse Uses

type TemplatesResponse struct {
    Response
    Data []Template `json:"data"`
}

TemplatesResponse represents a response from an API method that returns a collection of Template struct.

type TemplatesService Uses

type TemplatesService struct {
    // contains filtered or unexported fields
}

TemplatesService handles communication with the template related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/templates/

func (*TemplatesService) ApplyTemplate Uses

func (s *TemplatesService) ApplyTemplate(ctx context.Context, accountID string, templateIdentifier string, domainIdentifier string) (*TemplateResponse, error)

ApplyTemplate applies a template to the given domain.

See https://developer.dnsimple.com/v2/templates/domains/#applyTemplateToDomain

func (*TemplatesService) CreateTemplate Uses

func (s *TemplatesService) CreateTemplate(ctx context.Context, accountID string, templateAttributes Template) (*TemplateResponse, error)

CreateTemplate creates a new template.

See https://developer.dnsimple.com/v2/templates/#create

func (*TemplatesService) CreateTemplateRecord Uses

func (s *TemplatesService) CreateTemplateRecord(ctx context.Context, accountID string, templateIdentifier string, templateRecordAttributes TemplateRecord) (*TemplateRecordResponse, error)

CreateTemplateRecord creates a new template record.

See https://developer.dnsimple.com/v2/templates/records/#create

func (*TemplatesService) DeleteTemplate Uses

func (s *TemplatesService) DeleteTemplate(ctx context.Context, accountID string, templateIdentifier string) (*TemplateResponse, error)

DeleteTemplate deletes a template.

See https://developer.dnsimple.com/v2/templates/#delete

func (*TemplatesService) DeleteTemplateRecord Uses

func (s *TemplatesService) DeleteTemplateRecord(ctx context.Context, accountID string, templateIdentifier string, templateRecordID int64) (*TemplateRecordResponse, error)

DeleteTemplateRecord deletes a template record.

See https://developer.dnsimple.com/v2/templates/records/#delete

func (*TemplatesService) GetTemplate Uses

func (s *TemplatesService) GetTemplate(ctx context.Context, accountID string, templateIdentifier string) (*TemplateResponse, error)

GetTemplate fetches a template.

See https://developer.dnsimple.com/v2/templates/#get

func (*TemplatesService) GetTemplateRecord Uses

func (s *TemplatesService) GetTemplateRecord(ctx context.Context, accountID string, templateIdentifier string, templateRecordID int64) (*TemplateRecordResponse, error)

GetTemplateRecord fetches a template record.

See https://developer.dnsimple.com/v2/templates/records/#get

func (*TemplatesService) ListTemplateRecords Uses

func (s *TemplatesService) ListTemplateRecords(ctx context.Context, accountID string, templateIdentifier string, options *ListOptions) (*TemplateRecordsResponse, error)

ListTemplateRecords list the templates for an account.

See https://developer.dnsimple.com/v2/templates/records/#list

func (*TemplatesService) ListTemplates Uses

func (s *TemplatesService) ListTemplates(ctx context.Context, accountID string, options *ListOptions) (*TemplatesResponse, error)

ListTemplates list the templates for an account.

See https://developer.dnsimple.com/v2/templates/#list

func (*TemplatesService) UpdateTemplate Uses

func (s *TemplatesService) UpdateTemplate(ctx context.Context, accountID string, templateIdentifier string, templateAttributes Template) (*TemplateResponse, error)

UpdateTemplate updates a template.

See https://developer.dnsimple.com/v2/templates/#update

type Tld Uses

type Tld struct {
    Tld                 string `json:"tld"`
    TldType             int    `json:"tld_type"`
    WhoisPrivacy        bool   `json:"whois_privacy"`
    AutoRenewOnly       bool   `json:"auto_renew_only"`
    MinimumRegistration int    `json:"minimum_registration"`
    RegistrationEnabled bool   `json:"registration_enabled"`
    RenewalEnabled      bool   `json:"renewal_enabled"`
    TransferEnabled     bool   `json:"transfer_enabled"`
}

Tld represents a TLD in DNSimple.

type TldExtendedAttribute Uses

type TldExtendedAttribute struct {
    Name        string                       `json:"name"`
    Description string                       `json:"description"`
    Required    bool                         `json:"required"`
    Options     []TldExtendedAttributeOption `json:"options"`
}

TldExtendedAttribute represents an extended attributes supported or required by a specific TLD.

See https://developer.dnsimple.com/v2/tlds/

type TldExtendedAttributeOption Uses

type TldExtendedAttributeOption struct {
    Title       string `json:"title"`
    Value       string `json:"value"`
    Description string `json:"description"`
}

TldExtendedAttributeOption represents a single option you can assign to an extended attributes.

See https://developer.dnsimple.com/v2/tlds/

type TldExtendedAttributesResponse Uses

type TldExtendedAttributesResponse struct {
    Response
    Data []TldExtendedAttribute `json:"data"`
}

TldExtendedAttributesResponse represents a response from an API method that returns a collection of Tld extended attributes.

type TldResponse Uses

type TldResponse struct {
    Response
    Data *Tld `json:"data"`
}

TldResponse represents a response from an API method that returns a Tld struct.

type TldsResponse Uses

type TldsResponse struct {
    Response
    Data []Tld `json:"data"`
}

TldsResponse represents a response from an API method that returns a collection of Tld struct.

type TldsService Uses

type TldsService struct {
    // contains filtered or unexported fields
}

TldsService handles communication with the Tld related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/tlds/

func (*TldsService) GetTld Uses

func (s *TldsService) GetTld(ctx context.Context, tld string) (*TldResponse, error)

GetTld fetches a TLD.

See https://developer.dnsimple.com/v2/tlds/#get

func (*TldsService) GetTldExtendedAttributes Uses

func (s *TldsService) GetTldExtendedAttributes(ctx context.Context, tld string) (*TldExtendedAttributesResponse, error)

GetTldExtendedAttributes fetches the extended attributes of a TLD.

See https://developer.dnsimple.com/v2/tlds/#get

func (*TldsService) ListTlds Uses

func (s *TldsService) ListTlds(ctx context.Context, options *ListOptions) (*TldsResponse, error)

ListTlds lists the supported TLDs.

See https://developer.dnsimple.com/v2/tlds/#list

type TransferDomainInput Uses

type TransferDomainInput struct {
    // The ID of the Contact to use as registrant for the domain
    RegistrantID int `json:"registrant_id"`
    // The Auth-Code required to transfer the domain.
    // This is provided by the current registrar of the domain.
    AuthCode string `json:"auth_code,omitempty"`
    // Set to true to enable the whois privacy service. An extra cost may apply.
    // Default to false.
    EnableWhoisPrivacy bool `json:"whois_privacy,omitempty"`
    // Set to true to enable the auto-renewal of the domain.
    // Default to true.
    EnableAutoRenewal bool `json:"auto_renew,omitempty"`
    // Required by some TLDs. Use Tlds.GetTldExtendedAttributes() to get the required entries.
    ExtendedAttributes map[string]string `json:"extended_attributes,omitempty"`
    // Required as confirmation of the price, only if the domain is premium.
    PremiumPrice string `json:"premium_price,omitempty"`
}

TransferDomainInput represents the attributes you can pass to a transfer API request. Some attributes are mandatory.

type User Uses

type User struct {
    ID    int64  `json:"id,omitempty"`
    Email string `json:"email,omitempty"`
}

User represents a DNSimple user.

type VanityDelegationResponse Uses

type VanityDelegationResponse struct {
    Response
    Data []VanityNameServer `json:"data"`
}

VanityDelegationResponse represents a response for vanity name server enable and disable operations.

type VanityNameServer Uses

type VanityNameServer struct {
    ID        int64  `json:"id,omitempty"`
    Name      string `json:"name,omitempty"`
    IPv4      string `json:"ipv4,omitempty"`
    IPv6      string `json:"ipv6,omitempty"`
    CreatedAt string `json:"created_at,omitempty"`
    UpdatedAt string `json:"updated_at,omitempty"`
}

VanityNameServer represents data for a single vanity name server

type VanityNameServerResponse Uses

type VanityNameServerResponse struct {
    Response
    Data []VanityNameServer `json:"data"`
}

VanityNameServerResponse represents a response for vanity name server enable and disable operations.

type VanityNameServersService Uses

type VanityNameServersService struct {
    // contains filtered or unexported fields
}

VanityNameServersService handles communication with Vanity Name Servers methods of the DNSimple API.

See https://developer.dnsimple.com/v2/vanity/

func (*VanityNameServersService) DisableVanityNameServers Uses

func (s *VanityNameServersService) DisableVanityNameServers(ctx context.Context, accountID string, domainIdentifier string) (*VanityNameServerResponse, error)

DisableVanityNameServers Vanity Name Servers for the given domain

See https://developer.dnsimple.com/v2/vanity/#disableVanityNameServers

func (*VanityNameServersService) EnableVanityNameServers Uses

func (s *VanityNameServersService) EnableVanityNameServers(ctx context.Context, accountID string, domainIdentifier string) (*VanityNameServerResponse, error)

EnableVanityNameServers Vanity Name Servers for the given domain

See https://developer.dnsimple.com/v2/vanity/#enableVanityNameServers

type Webhook Uses

type Webhook struct {
    ID  int64  `json:"id,omitempty"`
    URL string `json:"url,omitempty"`
}

Webhook represents a DNSimple webhook.

type WebhookResponse Uses

type WebhookResponse struct {
    Response
    Data *Webhook `json:"data"`
}

WebhookResponse represents a response from an API method that returns a Webhook struct.

type WebhooksResponse Uses

type WebhooksResponse struct {
    Response
    Data []Webhook `json:"data"`
}

WebhooksResponse represents a response from an API method that returns a collection of Webhook struct.

type WebhooksService Uses

type WebhooksService struct {
    // contains filtered or unexported fields
}

WebhooksService handles communication with the webhook related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/webhooks

func (*WebhooksService) CreateWebhook Uses

func (s *WebhooksService) CreateWebhook(ctx context.Context, accountID string, webhookAttributes Webhook) (*WebhookResponse, error)

CreateWebhook creates a new webhook.

See https://developer.dnsimple.com/v2/webhooks/#createWebhook

func (*WebhooksService) DeleteWebhook Uses

func (s *WebhooksService) DeleteWebhook(ctx context.Context, accountID string, webhookID int64) (*WebhookResponse, error)

DeleteWebhook PERMANENTLY deletes the webhook.

See https://developer.dnsimple.com/v2/webhooks/#deleteWebhook

func (*WebhooksService) GetWebhook Uses

func (s *WebhooksService) GetWebhook(ctx context.Context, accountID string, webhookID int64) (*WebhookResponse, error)

GetWebhook fetches a webhook.

See https://developer.dnsimple.com/v2/webhooks/#getWebhook

func (*WebhooksService) ListWebhooks Uses

func (s *WebhooksService) ListWebhooks(ctx context.Context, accountID string, _ *ListOptions) (*WebhooksResponse, error)

ListWebhooks lists the webhooks for an account.

See https://developer.dnsimple.com/v2/webhooks/#listWebhooks

type WhoamiData Uses

type WhoamiData struct {
    User    *User    `json:"user,omitempty"`
    Account *Account `json:"account,omitempty"`
}

WhoamiData represents an authenticated context that contains information about the current logged User and/or Account.

func Whoami Uses

func Whoami(ctx context.Context, c *Client) (data *WhoamiData, err error)

Whoami is a state-less shortcut to client.Whoami() that returns only the relevant Data.

type WhoamiResponse Uses

type WhoamiResponse struct {
    Response
    Data *WhoamiData `json:"data"`
}

WhoamiResponse represents a response from an API method that returns a Whoami struct.

type WhoisPrivacy Uses

type WhoisPrivacy struct {
    ID        int64  `json:"id,omitempty"`
    DomainID  int64  `json:"domain_id,omitempty"`
    Enabled   bool   `json:"enabled,omitempty"`
    ExpiresOn string `json:"expires_on,omitempty"`
    CreatedAt string `json:"created_at,omitempty"`
    UpdatedAt string `json:"updated_at,omitempty"`
}

WhoisPrivacy represents a whois privacy in DNSimple.

type WhoisPrivacyRenewal Uses

type WhoisPrivacyRenewal struct {
    ID             int64  `json:"id,omitempty"`
    DomainID       int64  `json:"domain_id,omitempty"`
    WhoisPrivacyID int64  `json:"whois_privacy_id,omitempty"`
    State          string `json:"string,omitempty"`
    Enabled        bool   `json:"enabled,omitempty"`
    ExpiresOn      string `json:"expires_on,omitempty"`
    CreatedAt      string `json:"created_at,omitempty"`
    UpdatedAt      string `json:"updated_at,omitempty"`
}

WhoisPrivacyRenewal represents a whois privacy renewal in DNSimple.

type WhoisPrivacyRenewalResponse Uses

type WhoisPrivacyRenewalResponse struct {
    Response
    Data *WhoisPrivacyRenewal `json:"data"`
}

WhoisPrivacyRenewalResponse represents a response from an API method that returns a WhoisPrivacyRenewal struct.

type WhoisPrivacyResponse Uses

type WhoisPrivacyResponse struct {
    Response
    Data *WhoisPrivacy `json:"data"`
}

WhoisPrivacyResponse represents a response from an API method that returns a WhoisPrivacy struct.

type Zone Uses

type Zone struct {
    ID        int64  `json:"id,omitempty"`
    AccountID int64  `json:"account_id,omitempty"`
    Name      string `json:"name,omitempty"`
    Reverse   bool   `json:"reverse,omitempty"`
    CreatedAt string `json:"created_at,omitempty"`
    UpdatedAt string `json:"updated_at,omitempty"`
}

Zone represents a Zone in DNSimple.

type ZoneDistribution Uses

type ZoneDistribution struct {
    Distributed bool `json:"distributed"`
}

ZoneDistribution is the result of the zone distribution check.

type ZoneDistributionResponse Uses

type ZoneDistributionResponse struct {
    Response
    Data *ZoneDistribution `json:"data"`
}

ZoneDistributionResponse represents a response from an API method that returns a ZoneDistribution struct.

type ZoneFile Uses

type ZoneFile struct {
    Zone string `json:"zone,omitempty"`
}

ZoneFile represents a Zone File in DNSimple.

type ZoneFileResponse Uses

type ZoneFileResponse struct {
    Response
    Data *ZoneFile `json:"data"`
}

ZoneFileResponse represents a response from an API method that returns a ZoneFile struct.

type ZoneListOptions Uses

type ZoneListOptions struct {
    // Select domains where the name contains given string.
    NameLike *string `url:"name_like,omitempty"`

    ListOptions
}

ZoneListOptions specifies the optional parameters you can provide to customize the ZonesService.ListZones method.

type ZoneRecord Uses

type ZoneRecord struct {
    ID           int64    `json:"id,omitempty"`
    ZoneID       string   `json:"zone_id,omitempty"`
    ParentID     int64    `json:"parent_id,omitempty"`
    Type         string   `json:"type,omitempty"`
    Name         string   `json:"name"`
    Content      string   `json:"content,omitempty"`
    TTL          int      `json:"ttl,omitempty"`
    Priority     int      `json:"priority,omitempty"`
    SystemRecord bool     `json:"system_record,omitempty"`
    Regions      []string `json:"regions,omitempty"`
    CreatedAt    string   `json:"created_at,omitempty"`
    UpdatedAt    string   `json:"updated_at,omitempty"`
}

ZoneRecord represents a zone record in DNSimple.

type ZoneRecordAttributes Uses

type ZoneRecordAttributes struct {
    ZoneID   string   `json:"zone_id,omitempty"`
    Type     string   `json:"type,omitempty"`
    Name     *string  `json:"name,omitempty"`
    Content  string   `json:"content,omitempty"`
    TTL      int      `json:"ttl,omitempty"`
    Priority int      `json:"priority,omitempty"`
    Regions  []string `json:"regions,omitempty"`
}

ZoneRecordAttributes represents the attributes you can send to create/update a zone record.

Compared to most other calls in this library, you should not use ZoneRecord as payload for record calls. This is because it can lead to side effects due to the inability of go to distinguish between a non-present string and an empty string. Name can be both, therefore a specific struct is required.

type ZoneRecordListOptions Uses

type ZoneRecordListOptions struct {
    // Select records where the name matches given string.
    Name *string `url:"name,omitempty"`

    // Select records where the name contains given string.
    NameLike *string `url:"name_like,omitempty"`

    // Select records of given type.
    // Eg. TXT, A, NS.
    Type *string `url:"type,omitempty"`

    ListOptions
}

ZoneRecordListOptions specifies the optional parameters you can provide to customize the ZonesService.ListZoneRecords method.

type ZoneRecordResponse Uses

type ZoneRecordResponse struct {
    Response
    Data *ZoneRecord `json:"data"`
}

ZoneRecordResponse represents a response from an API method that returns a ZoneRecord struct.

type ZoneRecordsResponse Uses

type ZoneRecordsResponse struct {
    Response
    Data []ZoneRecord `json:"data"`
}

ZoneRecordsResponse represents a response from an API method that returns a collection of ZoneRecord struct.

type ZoneResponse Uses

type ZoneResponse struct {
    Response
    Data *Zone `json:"data"`
}

ZoneResponse represents a response from an API method that returns a Zone struct.

type ZonesResponse Uses

type ZonesResponse struct {
    Response
    Data []Zone `json:"data"`
}

ZonesResponse represents a response from an API method that returns a collection of Zone struct.

type ZonesService Uses

type ZonesService struct {
    // contains filtered or unexported fields
}

ZonesService handles communication with the zone related methods of the DNSimple API.

See https://developer.dnsimple.com/v2/zones/

func (*ZonesService) CheckZoneDistribution Uses

func (s *ZonesService) CheckZoneDistribution(ctx context.Context, accountID string, zoneName string) (*ZoneDistributionResponse, error)

CheckZoneDistribution checks if a zone is fully distributed across DNSimple nodes.

See https://developer.dnsimple.com/v2/zones/#checkZoneDistribution

func (*ZonesService) CheckZoneRecordDistribution Uses

func (s *ZonesService) CheckZoneRecordDistribution(ctx context.Context, accountID string, zoneName string, recordID int64) (*ZoneDistributionResponse, error)

CheckZoneRecordDistribution checks if a zone is fully distributed across DNSimple nodes.

See https://developer.dnsimple.com/v2/zones/#checkZoneRecordDistribution

func (*ZonesService) CreateRecord Uses

func (s *ZonesService) CreateRecord(ctx context.Context, accountID string, zoneName string, recordAttributes ZoneRecordAttributes) (*ZoneRecordResponse, error)

CreateRecord creates a zone record.

See https://developer.dnsimple.com/v2/zones/records/#createZoneRecord

func (*ZonesService) DeleteRecord Uses

func (s *ZonesService) DeleteRecord(ctx context.Context, accountID string, zoneName string, recordID int64) (*ZoneRecordResponse, error)

DeleteRecord PERMANENTLY deletes a zone record from the zone.

See https://developer.dnsimple.com/v2/zones/records/#deleteZoneRecord

func (*ZonesService) GetRecord Uses

func (s *ZonesService) GetRecord(ctx context.Context, accountID string, zoneName string, recordID int64) (*ZoneRecordResponse, error)

GetRecord fetches a zone record.

See https://developer.dnsimple.com/v2/zones/records/#getZoneRecord

func (*ZonesService) GetZone Uses

func (s *ZonesService) GetZone(ctx context.Context, accountID string, zoneName string) (*ZoneResponse, error)

GetZone fetches a zone.

See https://developer.dnsimple.com/v2/zones/#getZone

func (*ZonesService) GetZoneFile Uses

func (s *ZonesService) GetZoneFile(ctx context.Context, accountID string, zoneName string) (*ZoneFileResponse, error)

GetZoneFile fetches a zone file.

See https://developer.dnsimple.com/v2/zones/#getZoneFile

func (*ZonesService) ListRecords Uses

func (s *ZonesService) ListRecords(ctx context.Context, accountID string, zoneName string, options *ZoneRecordListOptions) (*ZoneRecordsResponse, error)

ListRecords lists the zone records for a zone.

See https://developer.dnsimple.com/v2/zones/records/#listZoneRecords

func (*ZonesService) ListZones Uses

func (s *ZonesService) ListZones(ctx context.Context, accountID string, options *ZoneListOptions) (*ZonesResponse, error)

ListZones the zones for an account.

See https://developer.dnsimple.com/v2/zones/#listZones

func (*ZonesService) UpdateRecord Uses

func (s *ZonesService) UpdateRecord(ctx context.Context, accountID string, zoneName string, recordID int64, recordAttributes ZoneRecordAttributes) (*ZoneRecordResponse, error)

UpdateRecord updates a zone record.

See https://developer.dnsimple.com/v2/zones/records/#updateZoneRecord

Directories

PathSynopsis
webhookPackage webhook provides the support for reading and parsing the events sent from DNSimple via webhook.

Package dnsimple imports 15 packages (graph) and is imported by 63 packages. Updated 2020-07-18. Refresh now. Tools for package owners.