refactor for tests

This commit is contained in:
mpostma 2021-03-23 11:00:50 +01:00
parent 1f51fc8baf
commit 3cc3637e2d
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
22 changed files with 1676 additions and 1474 deletions

View file

@ -0,0 +1,37 @@
use std::path::PathBuf;
use uuid::Uuid;
use tokio::sync::{oneshot, mpsc};
use super::{Result, PayloadData, UpdateStatus, UpdateMeta};
pub enum UpdateMsg<D> {
Update {
uuid: Uuid,
meta: UpdateMeta,
data: mpsc::Receiver<PayloadData<D>>,
ret: oneshot::Sender<Result<UpdateStatus>>,
},
ListUpdates {
uuid: Uuid,
ret: oneshot::Sender<Result<Vec<UpdateStatus>>>,
},
GetUpdate {
uuid: Uuid,
ret: oneshot::Sender<Result<UpdateStatus>>,
id: u64,
},
Delete {
uuid: Uuid,
ret: oneshot::Sender<Result<()>>,
},
Create {
uuid: Uuid,
ret: oneshot::Sender<Result<()>>,
},
Snapshot {
uuid: Uuid,
path: PathBuf,
ret: oneshot::Sender<Result<()>>,
},
}