1pub const SUPPORTED_REPOS: [(&str, &str, &str); 5] = [
3 ("0", "gh", "github"),
4 ("1", "gt", "gitea"),
5 ("2", "gl", "gitlab"),
6 ("3", "cb", "codeberg"),
7 ("4", "fg", "forgejo"),
8];
9
10#[derive(PartialEq, Clone)]
24pub enum Platform {
25 Github,
26 Gitea,
27 Gitlab,
28 Codeberg,
29 Forgejo,
30}
31
32impl Platform {
33 pub fn name(&self) -> &'static str {
35 match self {
36 Platform::Github => "github",
37 Platform::Gitea => "gitea",
38 Platform::Gitlab => "gitlab",
39 Platform::Codeberg => "codeberg",
40 Platform::Forgejo => "forgejo",
41 }
42 }
43
44 pub fn max_repo_depth(&self) -> usize {
46 match self {
47 Platform::Github |
48 Platform::Codeberg |
49 Platform::Forgejo |
50 Platform::Gitea => 1,
51 Platform::Gitlab => usize::MAX,
52 }
53 }
54}