2018-11-13 23:48:48 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
|
|
|
|
easydns "deadbeef.codes/steven/goeasydns"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2019-06-23 07:02:46 +00:00
|
|
|
client := easydns.NewClient("https://sandbox.rest.easydns.net", "APITOKEN", "APIKEY") //change url to remove sandbox once you contact easydns support
|
2019-06-23 07:01:47 +00:00
|
|
|
recordList, err := client.GetRecordList("myeasydnssite.ca")
|
2018-11-13 23:48:48 +00:00
|
|
|
if err != nil {
|
2019-06-23 07:01:47 +00:00
|
|
|
log.Fatalf("failed to get records for myeasydnssite.ca: %v", err)
|
2018-11-13 23:48:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for _, record := range recordList.Data {
|
|
|
|
if record.Type == "TXT" {
|
|
|
|
fmt.Printf("ID: %s\n", record.ID)
|
|
|
|
fmt.Printf("Host: %s\n", record.Host)
|
|
|
|
fmt.Printf("Type: %s\n", record.Type)
|
|
|
|
fmt.Printf("rdata: %s\n", record.Rdata)
|
|
|
|
fmt.Printf("\n\n")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|