go.wit.com/log is now primitive

This commit is contained in:
Jeff Carr 2024-12-13 12:36:13 -06:00
parent df007743b0
commit 2c7b907496
Notes: Jeff Carr 2025-02-09 15:09:36 -06:00
// `autogen:go.mod`

module go.wit.com/lib/gui/cloudflare

go 1.22

toolchain go1.23.4

require (
	go.wit.com/gui v0.22.25
	go.wit.com/lib/gadgets v0.22.8
	go.wit.com/log v0.22.11
)

require (
	go.wit.com/dev/alexflint/arg v1.5.5 // indirect
	go.wit.com/dev/alexflint/scalar v1.2.4 // indirect
	go.wit.com/widget v1.1.28 // indirect
)

// `autogen:go.sum`

go.wit.com/dev/alexflint/arg v1.5.5 h1:c4jgIb4OvHjnCMRNSjOa1sNLl6WDxV6tIkMVezR9hCk=
go.wit.com/dev/alexflint/arg v1.5.5/go.mod h1:nH3F6TJDaAUgnLkC0WgRN/H047YfN1TYKaWPYr6B8lo=
go.wit.com/dev/alexflint/scalar v1.2.4 h1:zmBeEkObwz1lcelwfGNYP2GS6SQ9e0tdv7JdHwMZEEk=
go.wit.com/dev/alexflint/scalar v1.2.4/go.mod h1:kCNO1Fo5LnnK6+qa+zYhP5fdgfC1C+vx1ti99Md+FAM=
go.wit.com/gui v0.22.25 h1:qncgoJtb4F5uPI/7SpmbqRB7I78pN5OziWmiSQr2TUE=
go.wit.com/gui v0.22.25/go.mod h1:BPGaYNWRAvVGN+LwKtRUHwbhXyGRTOF0u7S5OMtwomA=
go.wit.com/lib/gadgets v0.22.8 h1:oPR8/6y8nIv7lepuTgas7BJ2GzyZjDKAhSDS2ORxZRQ=
go.wit.com/lib/gadgets v0.22.8/go.mod h1:lQNvWP5RNV9+qHLWStN/I9LfCDq9ZlH1IOKuuxPhoQA=
go.wit.com/log v0.22.11 h1:BiJe+S81kWrMqW1QyZVu1Es2d//WG9FAcZQEhZkkM4c=
go.wit.com/log v0.22.11/go.mod h1:LsP0nAH4hZEf2qj/F5UmGQT0OEJ3Q5698/P8ZOI2JuE=
go.wit.com/widget v1.1.28 h1:xBrJBJ/5qGXTRE2uyOEcCV+6xAq8+3kBgqsJc1kqkiM=
go.wit.com/widget v1.1.28/go.mod h1:9P1d7NRtyFwEkMS3ccpTEyRqZaFnScbWvE4MB5ooeZI=

// `autogen:`
5 changed files with 13 additions and 11 deletions

View File

@ -1,6 +1,10 @@
all:
all: vet
@echo this is a gui for the cloudflare package
vet:
@GO111MODULE=off go vet
@echo go vet: this go library package builds okay
goimports:
goimports -w *.go

10
api.go
View File

@ -90,10 +90,10 @@ func SetRow(dnsRow *RRT) {
// show the JSON
tmp := makeJSON(dnsRow)
log.Spew(tmp)
log.Info(tmp)
if CFdialog.curlNode != nil {
pretty, _ := FormatJSON(tmp)
log.Spew("http PUT curl =", pretty)
log.Info("http PUT curl =", pretty)
CFdialog.curlNode.SetText(pretty)
}
}
@ -116,7 +116,7 @@ func GetZonefile(c *ConfigT) *DNSRecords {
client := &http.Client{}
resp, err := client.Do(req)
// log.Spew("SPEWING", resp)
// log.Info("SPEWING", resp)
if err != nil {
log.Error(err, "http.Client error")
return nil
@ -128,7 +128,7 @@ func GetZonefile(c *ConfigT) *DNSRecords {
log.Error(err, "ioutil.ReadAll() error")
return nil
}
log.Spew("SPEWING", body)
log.Info("SPEWING", body)
pretty, err := FormatJSON(string(body))
if err != nil {
log.Error(err, "FormatJSON error")
@ -219,7 +219,7 @@ func GetZones(auth, email string) *DNSRecords {
*/
for _, record := range records.Result {
log.Spew("spew record:", record)
log.Info("spew record:", record)
log.Info("record:", record.Name, record.ID)
var newc *ConfigT

View File

@ -52,6 +52,6 @@ func Create(zone string, hostname string, value string) bool {
result := doCurlCreate(key, email, z.ZoneID, data)
pretty, _ := FormatJSON(result)
log.Spew("cloudflare.Create() result =", pretty)
log.Info("cloudflare.Create() result =", pretty)
return true
}

View File

@ -181,8 +181,6 @@ func curlPost(dnsRow *RRT) string {
log.Error(err)
return ""
}
log.Spew("http PUT body =", body)
pretty, _ := FormatJSON(string(body))
log.Log(CURL, "result =", pretty)
log.Log(CURL, "curl() END")

4
rr.go
View File

@ -130,7 +130,7 @@ func CreateRR(myGui *gui.Node, zone string, zoneID string) *gadgets.BasicWindow
CFdialog.resultNode.SetText(result)
pretty, _ := FormatJSON(result)
log.Spew(pretty)
log.Info(pretty)
})
group.NewButton("Update RR doCurl(PUT)", func() {
@ -142,7 +142,7 @@ func CreateRR(myGui *gui.Node, zone string, zoneID string) *gadgets.BasicWindow
CFdialog.resultNode.SetText(result)
pretty, _ := FormatJSON(result)
log.Spew(pretty)
log.Info(pretty)
})
// CFdialog.saveNode.Disable()