Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateFiles ¶
func ValidateFilesWASM ¶
ValidateFilesWASM takes the relative file paths found in a dropped directory (root directory name included as the prefix, matching what gets uploaded to the arti-input bucket), JSON-encoded as an array of strings (parsed by parseJSONStringArray below rather than encoding/json+reflect, to keep the WASM build's binary size down - see json_map.go in request/validate for the same pattern). An earlier version NUL-joined the paths instead; that was dropped after confirming (via a real browser session vs. an identical wasm binary run under Node) that an embedded NUL byte in the JS string does not reliably survive the syscall/js crossing in at least one real browser, even though it round-trips fine through pure JS join/split on the JS side. JSON's \uXXXX-style escaping avoids embedding any raw control byte in the string that crosses the boundary. isSFM selects which text format to look for (.sfm files when true, .usx when false), mirroring the form's text_format_sfm/text_format_usx radio choice.
It checks that each filename is recognized - setMediaType identifies the media type from its name/extension, and parseFilenames confirms the naming convention parses (book id, chapter, etc.) - without looking at file contents, using req.Testament to prune books the request didn't ask for. On success it writes a glob pattern covering the matched files (e.g. s3://arti-input/MyFolder/audio/*.mp3) into req.AudioData.AWSS3 and req.TextData.AWSS3; the full InputFile-level processing this package also does (unzip, setMediaType, parseFilenames) happens again for real once the files are uploaded and the server picks up the request.
Returns one message per problem file; an empty slice means every file in the tree was understood.
Types ¶
This section is empty.