aboutsummaryrefslogtreecommitdiff
path: root/src/forge/gitlab/config.rs
blob: 37186e817298e863512300622a3d610b2b548b76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()
    }
}