godaddygo

package module
v0.0.32-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 1, 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.

As of now, the domains endpoint is the only endpoint that is safe to use (or available for that matter). We plan on slowly integrating other endpoints, but figure the majority of people interested in an SDK for an Domain/DNS provider (GoDaddy) prob want to view or change DNS records.


Table of Contents



Installation

go get -u github.com/oze4/godaddygo


Usage

Things should be fairly self-explanatory, but this is enough to 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
  • We mirrored endpoints found in the GoDaddy docs

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