Update example file
This commit is contained in:
parent
15a59929e9
commit
cd4cb5c12e
@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/libdns/libdns"
|
"github.com/libdns/libdns"
|
||||||
@ -38,7 +39,6 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if testId != "" {
|
if testId != "" {
|
||||||
// fmt.Printf("Delete entry for %s (id:%s)\n", testName, testId)
|
// fmt.Printf("Delete entry for %s (id:%s)\n", testName, testId)
|
||||||
// _, err = provider.DeleteRecords(context.TODO(), zone, []libdns.Record{libdns.Record{
|
// _, err = provider.DeleteRecords(context.TODO(), zone, []libdns.Record{libdns.Record{
|
||||||
@ -52,7 +52,7 @@ func main() {
|
|||||||
_, err = provider.SetRecords(context.TODO(), zone, []libdns.Record{libdns.Record{
|
_, err = provider.SetRecords(context.TODO(), zone, []libdns.Record{libdns.Record{
|
||||||
Type: "TXT",
|
Type: "TXT",
|
||||||
Name: testName,
|
Name: testName,
|
||||||
Value: fmt.Sprintf("\"Replacement test entry created by libdns %s\"", time.Now()),
|
Value: fmt.Sprintf("Replacement test entry created by libdns %s", time.Now()),
|
||||||
TTL: time.Duration(30) * time.Second,
|
TTL: time.Duration(30) * time.Second,
|
||||||
ID: testId,
|
ID: testId,
|
||||||
}})
|
}})
|
||||||
@ -64,11 +64,11 @@ func main() {
|
|||||||
_, err = provider.AppendRecords(context.TODO(), zone, []libdns.Record{libdns.Record{
|
_, err = provider.AppendRecords(context.TODO(), zone, []libdns.Record{libdns.Record{
|
||||||
Type: "TXT",
|
Type: "TXT",
|
||||||
Name: testName,
|
Name: testName,
|
||||||
Value: fmt.Sprintf("\"This is a test entry created by libdns %s\"", time.Now()),
|
Value: fmt.Sprintf("This is a test entry created by libdns %s", time.Now()),
|
||||||
TTL: time.Duration(30) * time.Second,
|
TTL: time.Duration(30) * time.Second,
|
||||||
}})
|
}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("ERROR: %s\n", err.Error())
|
fmt.Printf("ERROR: %s\n", err.Error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user