2个不稳定版本

0.2.0 2024年7月17日
0.1.0 2024年7月16日

#1 in #kube

Download history 336/week @ 2024-07-14 63/week @ 2024-07-21 35/week @ 2024-07-28

434 每月下载量
用于 termscp

MIT 协议

81KB
1.5K SLoC

remotefs-kube

文档

~ Remotefs kube客户端 ~

@veeso 开发

当前版本:0.2.0 (17/07/2024)

License-MIT Repo stars Downloads counter Latest version Ko-fi


关于remotefs-kube ☁️

为Kube实现的remotefs客户端。

入门

首先,您需要将remotefs和客户端添加到项目的依赖项中

remotefs = "^0.2"
remotefs-kube = "^0.2"

支持以下功能

  • find: 启用RemoteFs的find()方法。(默认启用)
  • no-log: 禁用日志记录。默认情况下,此库将通过logcrate进行日志记录。

Kube客户端

以下是一个基本用法示例,使用与Scp客户端非常相似的Kube客户端。


// import remotefs trait and client
use remotefs::RemoteFs;
use remotefs_ssh::{SshConfigParseRule, SftpFs, SshOpts};
use std::path::Path;

let rt = Arc::new(
    tokio::runtime::Builder::new_current_thread()
    .enable_all()
    .build()
    .unwrap(),
);
let mut client: KubeFs = KubeFs::new("my-pod", &rt);

// connect
assert!(client.connect().is_ok());
// get working directory
println!("Wrkdir: {}", client.pwd().ok().unwrap().display());
// change working directory
assert!(client.change_dir(Path::new("/tmp")).is_ok());
// disconnect
assert!(client.disconnect().is_ok());

客户端兼容性表格 ✔️

以下表格说明了客户端客户端和远程文件系统特性格式方法的兼容性。

注意:connect()disconnect()is_connected() 必须始终支持,因此在表中省略。

客户端/方法 Kube
append_file 不支持
append 不支持
change_dir 支持
copy 支持
create_dir 支持
create_file 支持
create 不支持
exec 支持
exists 支持
list_dir 支持
mov 支持
open_file 支持
open 不支持
pwd 支持
remove_dir_all 支持
remove_dir 支持
remove_file 支持
setstat 支持
stat 支持
symlink 支持


变更日志 ⏳

查看remotefs-kube的变更日志 这里


许可证 📃

remotefs-kube采用MIT许可证。

您可以在这里阅读完整的许可证 这里

依赖项

~65MB
~1M SLoC