summaryrefslogtreecommitdiffstats
path: root/src/config/endpoint_config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/endpoint_config.rs')
-rw-r--r--src/config/endpoint_config.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/config/endpoint_config.rs b/src/config/endpoint_config.rs
new file mode 100644
index 0000000..2146910
--- /dev/null
+++ b/src/config/endpoint_config.rs
@@ -0,0 +1,33 @@
+use getset::{CopyGetters, Getters};
+use serde::Deserialize;
+
+#[derive(Clone, Debug, Getters, CopyGetters, Deserialize)]
+pub struct Endpoint {
+ #[getset(get = "pub")]
+ name: String,
+
+ #[getset(get = "pub")]
+ uri: String,
+
+ #[getset(get = "pub")]
+ endpoint_type: EndpointType,
+
+ /// Relative speed to other endpoints
+ ///
+ /// So if you have two servers, one with 12 cores and one with 24, you want to set "1" for the
+ /// first and "2" for the second (or "12" for the first and "24" for the second - the ratio is
+ /// the thing here)!
+ #[getset(get_copy = "pub")]
+ speed: usize,
+
+ /// Maximum number of jobs which are allowed on this endpoint
+ #[getset(get_copy = "pub")]
+ maxjobs: usize,
+}
+
+#[derive(Clone, Debug, Deserialize, Eq, PartialEq)]
+pub enum EndpointType {
+ Socket,
+ Http,
+}
+