mirror of https://github.com/chipsenkbeil/distant
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
Rust
46 lines
1.2 KiB
Rust
2 years ago
|
use super::{CommonConfig, NetworkConfig};
|
||
|
use clap::Args;
|
||
|
use distant_core::Destination;
|
||
|
use serde::{Deserialize, Serialize};
|
||
|
use service_manager::ServiceManagerKind;
|
||
|
|
||
|
/// Represents configuration settings for the distant manager
|
||
|
#[derive(Args, Debug, Default, Serialize, Deserialize)]
|
||
|
pub struct ManagerConfig {
|
||
|
#[clap(flatten)]
|
||
|
#[serde(flatten)]
|
||
|
pub common: CommonConfig,
|
||
|
|
||
|
#[clap(skip)]
|
||
|
pub connections: Vec<ManagerConnectionConfig>,
|
||
|
|
||
|
#[clap(flatten)]
|
||
|
#[serde(flatten)]
|
||
|
pub network: NetworkConfig,
|
||
|
|
||
|
#[clap(value_enum)]
|
||
|
pub service: Option<ServiceManagerKind>,
|
||
|
}
|
||
|
|
||
|
/// Represents configuration for some managed connection
|
||
|
#[derive(Debug, Serialize, Deserialize)]
|
||
|
pub enum ManagerConnectionConfig {
|
||
|
Distant(ManagerDistantConnectionConfig),
|
||
|
Ssh(ManagerSshConnectionConfig),
|
||
|
}
|
||
|
|
||
|
/// Represents configuration for a distant connection
|
||
|
#[derive(Debug, Serialize, Deserialize)]
|
||
|
pub struct ManagerDistantConnectionConfig {
|
||
|
pub name: String,
|
||
|
pub destination: Destination,
|
||
|
pub key_cmd: Option<String>,
|
||
|
}
|
||
|
|
||
|
/// Represents configuration for an SSH connection
|
||
|
#[derive(Debug, Serialize, Deserialize)]
|
||
|
pub struct ManagerSshConnectionConfig {
|
||
|
pub name: String,
|
||
|
pub destination: Destination,
|
||
|
}
|