Util functions

This commit is contained in:
Norberto A. (GitHub @Limesey) 2021-05-10 19:37:45 +01:00
parent 6ecf0ac469
commit ed1c9ad353
1 changed files with 24 additions and 0 deletions

24
src/util.go Normal file
View File

@ -0,0 +1,24 @@
package main
import "os"
func folderExists(folderPath string) bool {
_, err := os.Stat(folderPath)
return !os.IsNotExist(err)
}
func createSettings() {
// TO DO:
// Create JSON file with default settings
type DefaultSettings struct {
AuthenticationCookie string
}
}
func loadSettings() {
// Check if JSON file exists
// If so, load into struct
// Else, create settings and return
}