diff options
| author | Jeff Carr <[email protected]> | 2023-12-28 09:43:45 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-12-28 09:43:45 -0600 |
| commit | 88fb976119006a8b3e3ce806c22f4f9418850f3c (patch) | |
| tree | 620f2b162fe2a296efa693810d15b97dc40ef6af /examples/cloudflare/config.go | |
| parent | e697a29bab5806834106680892cd6efbe46df506 (diff) | |
Detect that a VPN is needed
IPv6() returns true if it's working
display duration
a 'DNS Lookup Status' window
actual dig results
display status and failure counters
count lookup failures and successes
add TCP dns lookup
logic to test if dns is working at all
add DNS over HTTPS
cloudflare new & update kind of working
holy shit, go.wit.com finally works with git mod tidy
working, but cloudflare api stuff is broken
AAAA '(none)' logic detection is better
cloudflare control panel
display the working real AAAA addresses
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'examples/cloudflare/config.go')
| -rw-r--r-- | examples/cloudflare/config.go | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/examples/cloudflare/config.go b/examples/cloudflare/config.go deleted file mode 100644 index a65ad25..0000000 --- a/examples/cloudflare/config.go +++ /dev/null @@ -1,71 +0,0 @@ -// This is a simple example -package main - -import ( - "os" - "log" - "bufio" - "strings" - - "go.wit.com/control-panel-dns/cloudflare" -) - -func saveConfig() { - log.Println("TODO") -} - -func readConfig() { - homeDir, err := os.UserHomeDir() - if err != nil { - log.Println("searchPaths() error. exiting here?") - } - filename := homeDir + "/" + configfile - log.Println("filename =", filename) - - readFileLineByLine(filename) - // os.Exit(0) -} - -// readFileLineByLine opens a file and reads through each line. -func readFileLineByLine(filename string) error { - // Open the file. - file, err := os.Open(filename) - if err != nil { - return err - } - defer file.Close() - - log.Println("readFileLineByLine() =", filename) - - // Create a new Scanner for the file. - scanner := bufio.NewScanner(file) - - // Read through each line using scanner. - for scanner.Scan() { - var newc *cloudflare.ConfigT - newc = new(cloudflare.ConfigT) - - line := scanner.Text() - parts := strings.Fields(line) - - if (len(parts) < 4) { - log.Println("readFileLineByLine() SKIP =", parts) - continue - } - - newc.Domain = parts[0] - newc.ZoneID = parts[1] - newc.Auth = parts[2] - newc.Email = parts[3] - - cloudflare.Config[parts[0]] = newc - log.Println("readFileLineByLine() =", newc.Domain, newc.ZoneID, newc.Auth, newc.Email) - } - - // Check for errors during Scan. - if err := scanner.Err(); err != nil { - return err - } - - return nil -} |
