Godaddy - This package implements the libdns interfaces for the Godaddy API

Godaddy for libdns

godoc reference

This package implements the libdns interfaces for the Godaddy API

Example

Here's a minimal example of how to get all your DNS records using this libdns provider (see _example/main.go)

package main

import (
	"context"
	"fmt"
	"log"
	"os"
	"time"

	godaddy "github.com/libdns/godaddy"
	"github.com/libdns/libdns"
)

func main() {
	token := os.Getenv("GODADDY_TOKEN")
	if token == "" {
		fmt.Printf("GODADDY_TOKEN not set\n")
		return
	}
	zone := os.Getenv("ZONE")
	if zone == "" {
		fmt.Printf("ZONE not set\n")
		return
	}
	provider := godaddy.Provider{
		APIToken: token,
	}

	records, err := provider.GetRecords(context.TODO(), zone)
	if err != nil {
		log.Fatalln("ERROR: %s\n", err.Error())
	}

	testName := "libdns-test"
	hasTestName := false

	for _, record := range records {
		fmt.Printf("%s (.%s): %s, %s\n", record.Name, zone, record.Value, record.Type)
		if record.Name == testName {
			hasTestName = true
		}
	}

	if !hasTestName {
		appendedRecords, err := provider.AppendRecords(context.TODO(), zone, []libdns.Record{
			libdns.Record{
				Type: "TXT",
				Name: testName,
				TTL:  time.Duration(600) * time.Second,
			},
		})

		if err != nil {
			log.Fatalln("ERROR: %s\n", err.Error())
		}

		fmt.Println("appendedRecords")
		fmt.Println(appendedRecords)
	} else {
		deleteRecords, err := provider.DeleteRecords(context.TODO(), zone, []libdns.Record{
			libdns.Record{
				Type: "TXT",
				Name: testName,
			},
		})

		if err != nil {
			log.Fatalln("ERROR: %s\n", err.Error())
		}

		fmt.Println("deleteRecords")
		fmt.Println(deleteRecords)
	}
}
Owner
Universal DNS provider client APIs for Go
null
Similar Resources

Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://developer.github.com/v4/).

githubv4 Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://docs.github.com/en/graphql). If you're looking for a client

Dec 26, 2022

Utilcanvas is a package which provides some utilities to interface with the Canvas LMS Api.

Utilcanvas Utilcanvas is a package which provides some utilities to interface with the Canvas LMS Api. Example usage c := utilcanvas.NewClient("https:

Dec 21, 2022

This package provides a Go interface for the Typeform API.

typeform This package provides a Go interface for the Typeform API

Dec 4, 2022

Go library for accessing the MyAnimeList API: http://myanimelist.net/modules.php?go=api

go-myanimelist go-myanimelist is a Go client library for accessing the MyAnimeList API. Project Status The MyAnimeList API has been stable for years a

Sep 28, 2022

Go client for the YNAB API. Unofficial. It covers 100% of the resources made available by the YNAB API.

YNAB API Go Library This is an UNOFFICIAL Go client for the YNAB API. It covers 100% of the resources made available by the YNAB API. Installation go

Oct 6, 2022

An API client for the Notion API implemented in Golang

An API client for the Notion API implemented in Golang

Dec 30, 2022

lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin to AWS Lambda and Amazon API Gateway.

aws-lambda-go-api-proxy makes it easy to run Golang APIs written with frameworks such as Gin with AWS Lambda and Amazon API Gateway.

Jan 6, 2023

A API scanner written in GOLANG to scan files recursively and look for API keys and IDs.

GO FIND APIS _____ ____ ______ _____ _ _ _____ _____ _____ _____ / ____|/ __ \ | ____|_ _| \ | | __ \ /\ | __ \_

Oct 25, 2021

The NVD API is an unofficial Go wrapper around the NVD API.

NVD API The NVD API is an unofficial Go wrapper around the NVD API. Supports: CVE CPE How to use The following shows how to basically use the wrapper

Jan 7, 2023
Comments
  • delete records individually for safety

    delete records individually for safety

    This PR changes the logic for the DeleteRecords() method so that it will now iterate through eligible records and send a separate API call to GoDaddy for each delete request. This change should be 100% compatible with the former logic. Additionally I have verified correct functionality in a bulk rotation tool that I use.

    The previous logic would identify the slice of "remainder records" based on the user's request to eliminate a subset, and then send this slice of "remainder records" in one API call to GoDaddy. If that single GoDaddy call fails or has any problem, it could result in a disaster situation where large groups of records become missing. My thought is that with the atomic-style single deletes, the risk is reduced and specific to the delete records. This also leaves the "remainder records" alone which is safer (after all, those are the records you never intended to change at all).

    Please feel free to critique or let me know if I've done anything wrong here. I apologize that I'm new to Github. Thank you

  • Possible issue related to delete in large Godaddy zone

    Possible issue related to delete in large Godaddy zone

    Hello, I am using certmagic library along with multiple DNS providers including this one.

    I am concerned that the DeleteRecords method appears to be updating the entire zone at once. I will try to track down the Godaddy API to confirm if this is the only way.

    Our Godaddy zone is very large and contains more than 1000 records. Today for the first time we had an incident that caused about 50% of our GoDaddy zone to get deleted - based on our logs, I think this may have occurred during the ACME portions involving delete of the TXT record.

    No errors were logged from either certmagic or our code (everything appeared normal) - however, about 50% of our zone disappeared after these transactions. Fortunately we had a backup and were able to restore. However, Godaddy support was not helpful and/or unable to confirm that the zone issue was related to a specific API transaction.

    I would prefer if the delete operations could be more atomic - to reduce risk on other records. However, I understand this may not be possible if the Godaddy API does not support it.

    Thanks

    PS: here are the supported GoDaddy API methods related to DNS: godaddy_dns_api

    PPS: sorry, long day. In looking at their DELETE method... I wonder if this would be safer. If requires the type and name, so that would be an atomic transaction. It would safer to iterate in a loop of 100 atomic API calls to delete 100 records ... vs 1 API call deleting the 100 records.

    PPPS: I'm a Github newb, but should be able to submit a PR for this updated logic if wanted. May just take me a few days.

  • Fix for TTL not updating in GoDaddy - closes #4

    Fix for TTL not updating in GoDaddy - closes #4

    This PR is a fix for the TTL not being honored. I've also confirmed this fixed the issue and that custom TTL values are now properly updated in GoDaddy.

    Thank you

  • not honoring TTL in API requests

    not honoring TTL in API requests

    I've just learned that the TTL setting is not working correctly for the AppendRecords method. In all cases, it seems that TTL is not sent in the call, which results in GoDaddy defaulting (or changing) records to 600 seconds.

    I briefly reviewed the provider.go code and I think the issue is in the struct data (payload)... looks like only the record value is being sent. I should be able to fix this.

    Thank you

Package rhymen/go-whatsapp implements the WhatsApp Web API to provide a clean interface for developers

go-whatsapp Package rhymen/go-whatsapp implements the WhatsApp Web API to provide a clean interface for developers. Big thanks to all contributors of

Mar 19, 2022
🔌 RR plugins interfaces and proto API
🔌  RR plugins interfaces and proto API

RoadRunner API RR API consists of 2 parts: Plugin interfaces. Proto API for the PHP clients, at the moment released as V1Beta. Plugins should depend o

Jan 5, 2023
Go library to interface with Solana JSON RPC and WebSocket interfaces
Go library to interface with Solana JSON RPC and WebSocket interfaces

Solana SDK library for Go Go library to interface with Solana JSON RPC and WebSocket interfaces. Clients for Solana native programs, Solana Program Li

Mar 2, 2022
A thin go client that interfaces with AWS SSM

go-ssm-aws A thin go client that interfaces with AWS SSM. Why this package? This

May 14, 2022
This project implements a Go client library for the Hipchat API.

Hipchat This project implements a Go client library for the Hipchat API (API version 2 is not supported). Pull requests are welcome as the API is limi

Jan 3, 2023
GoStorm is a Go library that implements the communications protocol required to write Storm spouts and Bolts in Go that communicate with the Storm shells.

gostorm godocs GoStorm is a Go library that implements the communications protocol required for non-Java languages to communicate as part of a storm t

Sep 27, 2022
This library implements the pub/sub pattern in a generic way. It uses Go's generic types to declare the type of the event.

observer This library implements the pub/sub pattern in a generic way. It uses Go's generic types to declare the type of the event. Usage go get githu

Nov 16, 2022
Elastos.ELA.Rosetta.API - How to write a Rosetta server and use either the Client package or Fetcher package to communicate

Examples This folder demonstrates how to write a Rosetta server and how to use e

Jan 17, 2022
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key

Simple Weather API Simple weather api app created using golang and Open Weather

Feb 6, 2022
Go package providing opinionated tools and methods for working with the `aws-sdk-go/service/cloudfront` package.

go-aws-cloudfront Go package providing opinionated tools and methods for working with the aws-sdk-go/service/cloudfront package. Documentation Tools $

Feb 2, 2022