
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
github.com/libdns/godaddy
libdns
This package implements the libdns interfaces for the Godaddy API
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)
}
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.