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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct DisableDefaultPrefix(pub bool);

impl DisableDefaultPrefix {
    pub fn value(&self) -> bool {
        self.0
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Global(pub bool);

impl Global {
    pub fn value(&self) -> bool {
        self.0
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ServiceName(pub &'static str);

impl ServiceName {
    pub fn value(&self) -> &'static str {
        self.0
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ServiceType {
    Service,
    Controller,
    Interceptor,
}

impl ServiceType {
    pub fn value(&self) -> &Self {
        self
    }
}

impl From<&str> for ServiceType {
    fn from(value: &str) -> Self {
        match value {
            "Service" => ServiceType::Service,
            "ControllerService" => ServiceType::Controller,
            "InterceptorService" => ServiceType::Interceptor,
            _ => panic!("Invalid service type"),
        }
    }
}

impl Into<&'static str> for ServiceType {
    fn into(self) -> &'static str {
        match self {
            ServiceType::Service => "Service",
            ServiceType::Controller => "ControllerService",
            ServiceType::Interceptor => "InterceptorService",
        }
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ModuleName(pub &'static str);

impl ModuleName {
    pub fn value(&self) -> &'static str {
        self.0
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct ControllerPath(pub &'static str);

impl ControllerPath {
    pub fn value(&self) -> &'static str {
        self.0
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct RouterPath(pub &'static str);

impl RouterPath {
    pub fn value(&self) -> &'static str {
        self.0
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct RouterMethod(pub &'static str);

impl RouterMethod {
    pub fn value(&self) -> &'static str {
        self.0
    }
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct RouterName(pub &'static str);

impl RouterName {
    pub fn value(&self) -> &'static str {
        self.0
    }
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RouterFullPath(pub String);

impl RouterFullPath {
    pub fn value(&self) -> &String {
        &self.0
    }
}