https://github.com/threefoldtech/zinit-client
A Rust client library for interacting with the Zinit https://github.com/threefoldtech/zinit service manager.
https://github.com/threefoldtech/zinit-client
init service service-manager system-manager
Last synced: 4 months ago
JSON representation
A Rust client library for interacting with the Zinit https://github.com/threefoldtech/zinit service manager.
- Host: GitHub
- URL: https://github.com/threefoldtech/zinit-client
- Owner: threefoldtech
- License: apache-2.0
- Created: 2025-04-06T13:01:49.000Z (about 1 year ago)
- Default Branch: development
- Last Pushed: 2025-07-08T10:51:24.000Z (11 months ago)
- Last Synced: 2025-09-20T00:34:27.227Z (9 months ago)
- Topics: init, service, service-manager, system-manager
- Language: Rust
- Homepage:
- Size: 173 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Zinit Client
[](https://crates.io/crates/zinit-client)
[](https://docs.rs/zinit-client)
[](https://opensource.org/licenses/MIT)
A Rust client library for the [Zinit](https://github.com/threefoldtech/zinit) service manager.
## Features
- **Zero Configuration**: Automatically detects server version and protocol
- **Complete API**: All Zinit operations (list, start, stop, create, delete, etc.)
- **Async/Await**: Built on Tokio for high performance
- **Type Safe**: Strongly typed service states and responses
- **Error Handling**: Comprehensive error types with helpful messages
- **Backward Compatible**: Works with legacy Zinit installations
## Installation
Add this to your `Cargo.toml`:
```toml
[dependencies]
zinit-client = "0.4.0"
```
## Quick Start
```rust
use zinit_client::ZinitClient;
#[tokio::main]
async fn main() -> Result<(), Box> {
let client = ZinitClient::new("/var/run/zinit.sock");
// List all services
let services = client.list().await?;
println!("Services: {:?}", services);
// Start a service
client.start("my-service").await?;
// Get service status
let status = client.status("my-service").await?;
println!("Status: {:?}", status);
Ok(())
}
```
## API Overview
### Service Management
```rust
// List all services
let services = client.list().await?;
// Service lifecycle
client.start("service-name").await?;
client.stop("service-name").await?;
client.restart("service-name").await?;
// Get detailed status
let status = client.status("service-name").await?;
// Create/delete services (if supported by server)
client.create_service("name", config).await?;
client.delete_service("name").await?;
```
## Examples
Run the demo to see the universal interface in action:
```bash
cargo run --example
```
## Documentation
For detailed API documentation, visit [docs.rs/zinit-client](https://docs.rs/zinit-client).
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.