Add offline secrets fetch feature

This commit is contained in:
Maidul Islam
2023-02-03 21:02:36 -08:00
parent 0d57a26925
commit e16c0e53ff
3 changed files with 129 additions and 9 deletions
+9
View File
@@ -2,6 +2,7 @@ package util
import (
"fmt"
"net/http"
"os"
)
@@ -19,3 +20,11 @@ func WriteToFile(fileName string, dataToWrite []byte, filePerm os.FileMode) erro
return nil
}
func CheckIsConnectedToInternet() (ok bool) {
_, err := http.Get("http://clients3.google.com/generate_204")
if err != nil {
return false
}
return true
}