ringdrop 0.11.1

P2P streamed file transfer with ring-based access control, built on iroh and bao protocols
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::path::Path;

use anyhow::Result;

use crate::daemon::protocol::Op;

use super::PeerCmd;

pub(crate) async fn run(cmd: PeerCmd, data_dir: &Path) -> Result<()> {
    let client = super::daemon_client(data_dir)?;
    let op = match cmd {
        PeerCmd::Add { peer, nickname } => Op::PeerAdd { peer, nickname },
        PeerCmd::List => Op::PeerList,
        PeerCmd::Remove { peer } => Op::PeerRemove { peer },
    };
    client.run(op).await
}