WIP create a handler to download a file chunk by chunk.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
pub enum VideoError {
|
||||
VideoDoesNotExists,
|
||||
FolderDoesNotExists,
|
||||
FolderBrowsingTechnicalIssue,
|
||||
FileReadingTechnicalIssue
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
pub mod model;
|
||||
pub mod error;
|
||||
pub mod model;
|
||||
pub mod port;
|
||||
@@ -1,3 +1,5 @@
|
||||
use uuid::Uuid;
|
||||
|
||||
pub enum VideoFormat {
|
||||
AVI,
|
||||
MKV,
|
||||
@@ -6,7 +8,11 @@ pub enum VideoFormat {
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
pub trait VideoFile {}
|
||||
|
||||
pub struct Video {
|
||||
filename: String,
|
||||
format: VideoFormat
|
||||
pub id: Uuid,
|
||||
pub filename: String,
|
||||
pub file: Box<dyn VideoFile>,
|
||||
pub format: VideoFormat,
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
use uuid::Uuid;
|
||||
use crate::video::error::VideoError;
|
||||
use crate::video::model::Video;
|
||||
|
||||
pub trait VideoPort: Send + Sync {
|
||||
fn list_root(&self) -> Result<Vec<Video>, VideoError>;
|
||||
fn list_folder(&self, folder_id: Uuid) -> Result<Vec<Video>, VideoError>;
|
||||
fn get_video_stream(&self, video_id: Uuid) -> Result<Video, VideoError>;
|
||||
fn clone_box(&self) -> Box<dyn VideoPort>;
|
||||
}
|
||||
|
||||
impl Clone for Box<dyn VideoPort> {
|
||||
fn clone(&self) -> Self {
|
||||
self.clone_box()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user