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

36 lines
698 B
Go
Raw Normal View History

package main
import (
"go.wit.com/log"
"go.wit.com/gui"
"go.wit.com/control-panel-dns/cloudflare"
)
var title string = "Cloudflare DNS Control Panel"
2023-12-21 09:39:33 -06:00
var myGui *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() {
// send all log() output to a file in /tmp
log.SetTmp()
2023-12-21 09:39:33 -06:00
// 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()
}