2021-04-22 10:14:29 +02:00
|
|
|
use std::collections::HashSet;
|
2021-03-23 11:00:50 +01:00
|
|
|
use std::path::PathBuf;
|
|
|
|
|
2021-03-24 11:29:11 +01:00
|
|
|
use tokio::sync::{mpsc, oneshot};
|
2021-03-23 11:00:50 +01:00
|
|
|
use uuid::Uuid;
|
|
|
|
|
2021-06-14 21:26:35 +02:00
|
|
|
use super::error::Result;
|
2021-06-15 17:39:07 +02:00
|
|
|
use super::{PayloadData, UpdateMeta, UpdateStatus, UpdateStoreInfo};
|
2021-03-23 11:00:50 +01:00
|
|
|
|
|
|
|
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<()>>,
|
|
|
|
},
|
|
|
|
Snapshot {
|
2021-04-22 10:14:29 +02:00
|
|
|
uuids: HashSet<Uuid>,
|
2021-03-23 11:00:50 +01:00
|
|
|
path: PathBuf,
|
|
|
|
ret: oneshot::Sender<Result<()>>,
|
|
|
|
},
|
2021-04-28 16:43:49 +02:00
|
|
|
Dump {
|
2021-05-25 16:33:09 +02:00
|
|
|
uuids: HashSet<Uuid>,
|
2021-04-28 16:43:49 +02:00
|
|
|
path: PathBuf,
|
|
|
|
ret: oneshot::Sender<Result<()>>,
|
|
|
|
},
|
2021-04-14 18:55:04 +02:00
|
|
|
GetInfo {
|
|
|
|
ret: oneshot::Sender<Result<UpdateStoreInfo>>,
|
2021-04-09 14:41:24 +02:00
|
|
|
},
|
2021-03-23 11:00:50 +01:00
|
|
|
}
|