WIP on get channel info for arch app
This commit is contained in:
18
archapp_wrap/Cargo.toml
Normal file
18
archapp_wrap/Cargo.toml
Normal file
@@ -0,0 +1,18 @@
|
||||
[package]
|
||||
name = "archapp_wrap"
|
||||
version = "0.0.1-a.dev.4"
|
||||
authors = ["Dominik Werder <dominik.werder@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
serde = "1.0.126"
|
||||
serde_json = "1.0.64"
|
||||
async-channel = "1.6"
|
||||
futures-core = "0.3.15"
|
||||
futures-util = "0.3.15"
|
||||
err = { path = "../err" }
|
||||
netpod = { path = "../netpod" }
|
||||
archapp = { path = "../archapp" }
|
||||
archapp_xc = { path = "../archapp_xc" }
|
||||
disk = { path = "../disk" }
|
||||
items = { path = "../items" }
|
||||
28
archapp_wrap/src/lib.rs
Normal file
28
archapp_wrap/src/lib.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use archapp_xc::RT1;
|
||||
use async_channel::Receiver;
|
||||
use err::Error;
|
||||
use futures_core::Stream;
|
||||
use items::Framable;
|
||||
use netpod::query::RawEventsQuery;
|
||||
use netpod::{ArchiverAppliance, Channel, ChannelInfo, NodeConfigCached};
|
||||
use std::collections::BTreeMap;
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
|
||||
pub fn scan_files(
|
||||
pairs: BTreeMap<String, String>,
|
||||
node_config: NodeConfigCached,
|
||||
) -> Pin<Box<dyn Future<Output = Result<Receiver<Result<RT1, Error>>, Error>> + Send>> {
|
||||
Box::pin(archapp::parse::scan_files_inner(pairs, node_config))
|
||||
}
|
||||
|
||||
pub async fn make_event_pipe(
|
||||
evq: &RawEventsQuery,
|
||||
aa: &ArchiverAppliance,
|
||||
) -> Result<Pin<Box<dyn Stream<Item = Box<dyn Framable>> + Send>>, Error> {
|
||||
archapp::events::make_event_pipe(evq, aa).await
|
||||
}
|
||||
|
||||
pub async fn channel_info(channel: &Channel, node_config: &NodeConfigCached) -> Result<ChannelInfo, Error> {
|
||||
archapp::events::channel_info(channel, node_config).await
|
||||
}
|
||||
Reference in New Issue
Block a user