Better structure of files; introduced XML models

This commit is contained in:
Simon Martens
2025-01-01 17:00:26 +01:00
parent e46d540c01
commit 7539a2dca7
25 changed files with 297 additions and 348 deletions

View File

@@ -4,6 +4,7 @@ import (
"encoding/xml"
"io"
"os"
"path/filepath"
"github.com/Theodor-Springmann-Stiftung/kgpz_web/helpers/logging"
)
@@ -30,3 +31,13 @@ func UnmarshalFile[T any](filename string, data T) error {
}
return nil
}
func XMLFilesForPath(path string) ([]string, error) {
if _, err := os.Stat(path); os.IsNotExist(err) {
return nil, err
}
matches, err := filepath.Glob(filepath.Join(path, "*.xml"))
return matches, err
}