control-panel-dns/examples/control-panel-cloudflare/main.go

41 lines
851 B
Go
Raw Normal View History

// This is a simple example
package main
import (
"go.wit.com/gui"
"go.wit.com/control-panel-dns/cloudflare"
)
var title string = "Cloudflare DNS Control Panel"
var outfile string = "/tmp/guilogfile"
var configfile string = ".config/wit/cloudflare"
2023-12-21 09:39:33 -06:00
var myGui *gui.Node
2023-12-21 09:39:33 -06:00
// var buttonCounter int = 5
// var gridW int = 5
// var gridH int = 3
2023-12-21 09:39:33 -06:00
// var mainWindow, more, more2 *gui.Node
2023-12-21 09:39:33 -06:00
// var cloudflareURL string = "https://api.cloudflare.com/client/v4/zones/"
2023-12-21 09:39:33 -06:00
func main() {
// parse the config file
readConfig()
2023-12-21 09:39:33 -06:00
// initialize a new GO GUI instance
myGui = gui.New().Default()
2023-12-21 09:39:33 -06:00
// draw the cloudflare control panel window
win := cloudflare.MakeCloudflareWindow(myGui)
win.SetText(title)
2023-12-21 09:39:33 -06:00
// This is just a optional goroutine to watch that things are alive
gui.Watchdog()
gui.StandardExit()
2023-12-21 09:39:33 -06:00
// update the config file
saveConfig()
}