Skip to main content

Crate herolib_os

Crate herolib_os 

Source
Expand description

§herolib-os

Unified system utilities for OS interaction, process management, git operations, network operations, and SSH.

§Modules

  • os: Operating system interaction utilities (filesystem, downloads, packages, platform detection)
  • process: Cross-platform process management and command execution
  • git: Git repository management and operations
  • net: Network connectivity utilities (TCP, HTTP)
  • ssh: SSH connections, file transfers, key management

For installation utilities, see the separate herolib-installers package. For virtualization, containerization, and Kubernetes tools, see the separate herolib-virt package.

§Features

  • rhai (default): Enable Rhai scripting support for all modules
  • kubernetes: Enable Kubernetes management functionality
  • full: Enable all features

§Example

use herolib_os::{os, process, git, net, ssh};

// Use OS utilities
let exists = os::exist("/tmp/myfile.txt");

// Run a command
let result = process::run_command("echo hello");

// Work with git repositories
let tree = git::GitTree::new("/path/to/repos");

// Check network connectivity
let is_open = net::tcp::TcpConnector::new().check_port_by_name("google.com", 443);

// SSH connection
let conn = ssh::SshConnection::builder()
    .host("example.com")
    .user("ubuntu")
    .build();

Modules§

git
Git repository management and operations.
net
Network connectivity and communication utilities.
os
Operating system utilities and abstractions.
process
SAL Process Package
profiling
System Profiling Module
rhai
Rhai integration for the OS System package
rsync
Rsync module for file synchronization.
ssh
SSH operations module.