mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-13 03:13:29 +02:00
move code to dagger-core
This commit is contained in:
30
crates/dagger-core/src/config.rs
Normal file
30
crates/dagger-core/src/config.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub struct Config {
|
||||
pub workdir_path: Option<PathBuf>,
|
||||
pub config_path: Option<PathBuf>,
|
||||
pub timeout_ms: u64,
|
||||
pub execute_timeout_ms: Option<u64>,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
fn default() -> Self {
|
||||
Self::new(None, None, None, None)
|
||||
}
|
||||
}
|
||||
|
||||
impl Config {
|
||||
pub fn new(
|
||||
workdir_path: Option<PathBuf>,
|
||||
config_path: Option<PathBuf>,
|
||||
timeout_ms: Option<u64>,
|
||||
execute_timeout_ms: Option<u64>,
|
||||
) -> Self {
|
||||
Self {
|
||||
workdir_path,
|
||||
config_path,
|
||||
timeout_ms: timeout_ms.unwrap_or(10 * 1000),
|
||||
execute_timeout_ms,
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user