summaryrefslogtreecommitdiff
path: root/cloudflare
diff options
context:
space:
mode:
Diffstat (limited to 'cloudflare')
-rw-r--r--cloudflare/api.go5
-rw-r--r--cloudflare/mainWindow.go13
2 files changed, 15 insertions, 3 deletions
diff --git a/cloudflare/api.go b/cloudflare/api.go
index 036adc7..293857f 100644
--- a/cloudflare/api.go
+++ b/cloudflare/api.go
@@ -2,12 +2,11 @@
package cloudflare
import (
- "log"
"encoding/json"
"io/ioutil"
"net/http"
- "github.com/davecgh/go-spew/spew"
+ "go.wit.com/log"
)
/*
@@ -205,7 +204,7 @@ func GetZones(auth, email string) *DNSRecords {
// log.Println("getZones() worked", records)
// log.Println("spew dump:")
- spew.Dump(records)
+ // spew.Dump(records)
for _, record := range records.Result {
log.Println("spew record:", record)
log.Println("record:", record.Name, record.ID)
diff --git a/cloudflare/mainWindow.go b/cloudflare/mainWindow.go
index af5b221..064b0bd 100644
--- a/cloudflare/mainWindow.go
+++ b/cloudflare/mainWindow.go
@@ -6,6 +6,7 @@ import (
"log"
"go.wit.com/gui"
+ "go.wit.com/gui/gadgets"
)
// This creates a window
@@ -79,8 +80,20 @@ func makeConfigWindow(n *gui.Node) {
grid.NewLabel("Cloudflare API")
grid.NewLabel(url)
+ hostname := gadgets.NewBasicEntry(grid, "hostname")
+ zone := gadgets.NewBasicEntry(grid, "domain name")
+
grid.Pad()
+ vb.NewButton("Lookup Hostname", func () {
+ log.Println("Find all the Resource Records for hostname:", hostname.Get())
+ log.Println("Find all the Resource Records for zone:", zone.Get())
+ GetZones(aw.S, ew.S)
+ for d, v := range Config {
+ log.Println("Zone =", d, "v =", v)
+ }
+ })
+
vb.NewButton("getZones()", func () {
log.Println("getZones()")
GetZones(aw.S, ew.S)