feat: make watchdog itself configurable

This commit is contained in:
DaanSelen
2026-04-22 16:29:07 +02:00
parent ec3a996d6a
commit fa832bd1e0
12 changed files with 59 additions and 53 deletions
-22
View File
@@ -4,8 +4,6 @@ import (
"crypto/sha512"
"encoding/hex"
"io"
"mime/multipart"
"os"
)
func HashReader(r io.Reader) (string, error) {
@@ -19,23 +17,3 @@ func HashReader(r io.Reader) (string, error) {
// alternatively return in base64
//return base64.StdEncoding.EncodeToString(h.Sum(nil)), nil
}
func HashUpload(fileHeader *multipart.FileHeader) (string, error) {
stream, err := fileHeader.Open()
if err != nil {
return "", err
}
defer stream.Close()
return HashReader(stream)
}
func HashFile(path string) (string, error) {
file, err := os.Open(path)
if err != nil {
return "", err
}
defer file.Close()
return HashReader(file)
}