feat: add upload chunker
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-02-18 22:25:43 +01:00
parent 6cf1a23169
commit 9cc3d80917
9 changed files with 153 additions and 34 deletions

View File

@@ -1,4 +1,4 @@
use std::path::PathBuf;
use std::{ops::Deref, path::PathBuf};
#[derive(Clone, Debug)]
pub struct CommitArtifact {
@@ -33,3 +33,28 @@ impl TryFrom<String> for ArtifactID {
Ok(ArtifactID(uuid))
}
}
pub struct UploadArtifact {
pub file_path: PathBuf,
}
impl From<PathBuf> for UploadArtifact {
fn from(value: PathBuf) -> Self {
Self { file_path: value }
}
}
pub struct UploadArtifactID(uuid::Uuid);
impl From<uuid::Uuid> for UploadArtifactID {
fn from(value: uuid::Uuid) -> Self {
Self(value)
}
}
impl Deref for UploadArtifactID {
type Target = uuid::Uuid;
fn deref(&self) -> &Self::Target {
&self.0
}
}