godaddygo

package module
v1.0.5 Latest Latest
Warning

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

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

README

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


Table of Contents



Installation

go get -u github.com/oze4/godaddygo


Usage

This library is rather "self-documenting" - we mirror the structure of the GoDaddy API.

View examples here.

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
godaddygo.NewProductionAPI(options).V1().Domain("dom.com").Records().Add(newDNSRecord)

With that being said, this should be enough to help get you started:

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

func main() {
	prodV1 := godaddy.NewProductionAPI(godaddy.NewOptions("myApiKey", "myApiSecret")).V1()
	
	// Can also target the development API (see the GoDaddy docs for more details)
	// devV1 := godaddy.NewDevelopmentAPI(godaddy.NewOptions("myApiKey", "myApiSecret")).V1()
	
	// 9 times out of 10 you will need to own the domain for your query
	// You can check for domain availability without owning the domain, for exmaple
	myDomain := prodV1.Domain("mydomain.com")
	myDomainRecords := myDomain.Records()
	myDomainZone := myDomainRecords.GetAll()

	// ...do something with `myDomainZone`
}

Type Checking

  • For user-land-type-checking, each endpoint has it's own package located at: github.com/oze4/godaddygo/pkg/endpoints/<endpoint>
  • The main package, (github.com/oze4/godaddygo) provides everything you need to interact with the GoDaddy API.
  • However, if you would like to type-check using types which are returned from godaddygo, you will need to use a specific package for "that" endpoint

If you wanted to type-check using the data type for domain details, you would do:

package xyz

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

func SomeFunc(dd domains.DomainDetails) { // <-- type-check using `DomainDetails`
  // ...
}

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 NewDevelopmentAPI added in v1.0.0

func NewDevelopmentAPI(o Options) api.Gateway

NewDevelopmentAPI targets GoDaddy's development API (https://api.ote-godaddy.com)

func NewProductionAPI added in v1.0.0

func NewProductionAPI(o Options) api.Gateway

NewProductionAPI targets GoDaddy's production API (https://api.godaddy.com)

Types

type Options added in v1.0.0

type Options interface {
	APIKey() string
	APISecret() string
}

Options hold the options for a new client

func NewOptions added in v1.0.0

func NewOptions(apikey, apisecret string) Options

NewOptions returns new options

Jump to

Keyboard shortcuts

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