about summary refs log tree commit diff
path: root/kittybox-rs/src/media/storage/mod.rs
Commit message (Collapse)AuthorAgeFilesLines
* media: improve Metadata typingVika2022-07-211-6/+8
| | | | | | | | | | | | | content_type is now optional; if not specified, it will remain empty. `application/octet-stream` will be put on read in the frontend. Length is now represented as NonZeroUsize - why would you upload a zero-byte file when you can just conjure one from the void whenever you need one? This should save me a little bit of memory. Representing content_type as a typed MIME value would be the next logical step.
* media: buffer disk I/O and add debug loggingVika2022-07-141-1/+2
| | | | It looks like buffering reads can double my performance. Nice.
* media: media endpoint PoCVika2022-07-101-12/+48
| | | | | | | | | | Supported features: - Streaming upload - Content-addressed storage - Metadata - MIME type (taken from Content-Type) - Length (I could use stat() for this one tho) - filename (for Content-Disposition: attachment, WIP)
* format using rustfmtVika2022-07-071-2/+11
|
* treewide: rewrite using AxumVika2022-07-071-0/+53
Axum has streaming bodies and allows to write simpler code. It also helps enforce stronger types and looks much more neat. This allows me to progress on the media endpoint and add streaming reads and writes to the MediaStore trait. Metrics are temporarily not implemented. Everything else was preserved, and the tests still pass, after adjusting for new calling conventions. TODO: create method routers for protocol endpoints