swarm-ssh

Crates.ioswarm-ssh
lib.rsswarm-ssh
version0.1.2
sourcesrc
created_at2022-12-16 06:08:34.84333
updated_at2022-12-16 06:46:35.376317
descriptionTransfer files via ssh protocol.
homepage
repositoryhttps://github.com/meta-fs/swarm
max_upload_size
id738522
size11,543
SasakiSaki (oovm)

documentation

https://docs.rs/swarm-ssh

README

Swarm SSH

Manage remote computers via ssh protocol.

Login

use diagnostic_quick::QResult;
use swarm_ssh::SwarmSSH;

async fn test_password() -> QResult<SwarmSSH> {
    SwarmSSH::login_password("192.168.1.100:22", "root", "password").await
}

Upload

use std::path::PathBuf;
use diagnostic_quick::QResult;
use swarm_ssh::SwarmSSH;

async fn test_password() -> QResult {
    let ssh = SwarmSSH::login_password("192.168.1.100:22", "root", "password").await?;
    let path = PathBuf::from("Cargo.toml");
    ssh.upload_task(&path, "/tmp/Cargo.toml")?.execute().await?;
    Ok(())
}

Download

use diagnostic_quick::QResult;
use swarm_ssh::SwarmSSH;

async fn test_password() -> QResult<SwarmSSH> {
    SwarmSSH::login_password("192.168.1.100:22", "root", "password").await
}
Commit count: 1

cargo fmt