godaddygo

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 2 Imported by: 8

README

godaddygo


Table of Contents


Intro

Hello and welcome! Thanks for checking us out 😄

This library currently supports:

  • Getting domain info
  • Checking domain availability
  • Getting DNS records
  • Setting DNS records

Whenever we reference endpoints, this is what we are referring to

Pull requests welcome! We plan on slowly integrating each GoDaddy endpoint

Installation

go get -u github.com/oze4/godaddygo

Usage

Default Client:

The godaddygo package wraps around the /pkg/endpoints package.

package main

import (
    "github.com/oze4/godaddygo"
)

func main() {
    // Options for client
    k := "api_key"
    s := "api_secret"
    // See here for more on GoDaddy production vs development (OTE) API's
    // https://developer.godaddy.com/getstarted
    targetProductionAPI := true 

    // Create new client
    client := godaddygo.NewClient(targetProductionAPI, k, s)
    
    // Connect our client to endpoints
    godaddy := godaddygo.Connect(client)

    //
    // Use `godaddy` here!
    //

    // For example
    prodv1 := godaddy.V1() // godaddy.V2() etc..
    // Target specific domain
    mydomain := prodv1.Domain("mydomain.com")
    // Get all DNS records for target domain
    records, err := mydomain.Records().GetAll()

    // ...
}
Custom Client

Again, the godaddygo package wraps around the /pkg/endpoints package. This means you have the ability to write your own client. As long as your client satisfies the session.Interface interface, you can pass it to endpoints.NewConnection(client).

This would look something like:

package main

import (
    "github.com/oze4/godaddygo/pkg/endpoints"
)

func main() {
    // Instead of doing `godaddy := godaddygo.Connect(client)`, which
    // just wraps around `endpoints.NewConnection`, you would do:
    godaddy := endpoints.NewConnection(myclient) // pretend `myclient` satisfies `session.Interface`

    // Use `godaddy` here! 

    //
    // The rest is the same as using the default client
    //
}
Our API Structure

Consider the following endpoint, which allows you to add a DNS record to a domain..

screenshot_from_godaddy_docs

Programmatically, this would look like:

// Simplified
godaddy.V1().Domain("dom.com").Records().Add(newDNSRecord)

Roadmap

Endpoints

Please see here for more information on GoDaddy API endpoints

Endpoint Status
Abuse -
Aftermarket -
Agreements -
Certificates -
Countries -
Domains Safe to get domain info and DNS records, as well as set DNS records
Orders -
Shoppers -
Subscriptions -



mattoestreich.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect added in v1.0.6

func Connect(godaddygoClient client.Interface) endpoints.Gateway

Connect connects you to GoDaddy API endpoints Just a wrapper around `endpoints.Connect(...)` and is mostly for convenience

func NewClient added in v1.0.6

func NewClient(prod bool, key, secret string) client.Interface

NewClient creates a new *default* client You do have the ability to create your own client Just a wrapper around `client.Default(...)` and is mostly for convenience

Types

This section is empty.

Jump to

Keyboard shortcuts

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