diff options
Diffstat (limited to 'src/forge/gitlab/config.rs')
| -rw-r--r-- | src/forge/gitlab/config.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/forge/gitlab/config.rs b/src/forge/gitlab/config.rs new file mode 100644 index 0000000..37186e8 --- /dev/null +++ b/src/forge/gitlab/config.rs @@ -0,0 +1,26 @@ +use serde::{Deserialize, Serialize}; +use std::path::PathBuf; + +use crate::config::ForgeConfigTrait; + +#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Deserialize, Serialize)] +pub struct Gitlab { + // pub url: url::Url, + pub host: String, + pub token: String, + pub directory: PathBuf, + #[serde(default = "default_tls")] + pub tls: bool, + #[serde(default)] + pub auto_create_branches: bool, +} + +const fn default_tls() -> bool { + true +} + +impl ForgeConfigTrait for Gitlab { + fn root(&self) -> &str { + self.directory.to_str().unwrap() + } +} |
