feat: initial file upload api (#4299)

* feat: initial file upload api

* feat: initial file upload api

* fix: add pb index

* feat: remove file name

* feat: read everything to mem

* feat: revamp object storage

* chore: cargo format

* chore: update deps

* feat: revised implementations and style

* chore: use deploy env instead

* chore: use deploy env instead

* chore: use deploy env instead

* refactor: move logic to handler to manager

* fix: format issues

* fix: cargo clippy

* chore: cargo check tauri

* fix: debug docker integration test

* fix: debug docker integration test

* fix: debug docker integration test gotrue

* fix: debug docker integration test docker compose version

* fix: docker scripts

* fix: cargo fmt

* fix: add sleep after docker compose up

---------

Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
Zack
2024-01-17 02:59:15 +08:00
committed by GitHub
parent 15cb1b5f19
commit 38c3e700e9
30 changed files with 757 additions and 403 deletions

View File

@ -1,3 +1,4 @@
use std::path::Path;
use validator::ValidationError;
pub fn required_not_empty_str(s: &str) -> Result<(), ValidationError> {
@ -6,3 +7,11 @@ pub fn required_not_empty_str(s: &str) -> Result<(), ValidationError> {
}
Ok(())
}
pub fn required_valid_path(s: &str) -> Result<(), ValidationError> {
let path = Path::new(s);
match (path.is_absolute(), path.exists()) {
(true, true) => Ok(()),
(_, _) => Err(ValidationError::new("invalid_path")),
}
}