Uploads
Every upload protocol converges on one invariant: it yields a completed
FileID. Analysis and import only ever see that ID.
Multipart (default)
Section titled “Multipart (default)”POST /files/analyze with a file part stores the upload and analyzes it
in one round trip. No separate adapter needed.
TUS resumable uploads
Section titled “TUS resumable uploads”Mounted at /uploads/tus/* via mapperhttp.WithUploadExtension:
tusHandler := tus.New(tus.WithFileWriter(store))handler := mapperhttp.New(svc, store, tusHandler)TUS 1.0.0 core over plain net/http, no extra dependencies:
POSTcreation withUpload-LengthandUpload-Metadata(filename,filetype), optional first chunkHEADoffset discovery for resumePATCHchunk appends guarded byUpload-Offset(409on mismatch)DELETEtermination,OPTIONScapability negotiation
Chunks stream to disk; on completion the file lands in the FileStore and
the response carries X-Mapper-File-Id. Resume with that header flow:
POST → 201 + LocationPATCH → 204 + Upload-Offset (repeat, resuming from HEAD after drops)PATCH → 204 + X-Mapper-File-Id (complete)POST /files/analyze {"file_id": …}