diff options
| author | Jeff Carr <[email protected]> | 2023-12-29 17:29:47 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-12-29 17:29:47 -0600 |
| commit | 867b69f5557ebe5665c0d52467b8b4a5980aa33a (patch) | |
| tree | 537b1fb5cf8f428a95b7214edccab99efd75ad6a /cloudflare | |
| parent | a3dd21aef045f2038911585a238acac65884d314 (diff) | |
switch to using Register() from 'go-arg'
implement 'universal' use of go-arg
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'cloudflare')
| -rw-r--r-- | cloudflare/api.go | 5 | ||||
| -rw-r--r-- | cloudflare/mainWindow.go | 13 |
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) |
