From 8285d49a3dd9a2531e135bcd9282c3dfc8795dc6 Mon Sep 17 00:00:00 2001 From: Leopold Date: Fri, 25 Apr 2025 01:00:57 +0200 Subject: [PATCH] added comments explaining functions --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index aaa2cd9..9f9eefd 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,8 @@ func main() { } } +### Checks if the newest IPv6 on the first Interface is not equal to the provided one +### Returns the new IPv6 if it changed func checkForNewV6(lastIPv6 string) (string, bool) { interfaces, err := net.Interfaces() if err != nil { @@ -58,6 +60,7 @@ func checkForNewV6(lastIPv6 string) (string, bool) { return lastIPv6, false } +### Updates the Prefix on the Server func sendNewIP(config conf) error { _, err := http.Get(fmt.Sprintf("https://ipv6.dynv6.com/api/update?ipv6prefix=auto&token=%s&zone=%s", config.token, config.zone)) if err != nil { @@ -66,6 +69,7 @@ func sendNewIP(config conf) error { return nil } +### Reads all ENVIRONMENT variables func readConfigVars() (conf, error) { var zone, token, server string var present bool