summaryrefslogtreecommitdiff
path: root/src/models.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/models.rs b/src/models.rs
index 83153fd..624a1ce 100644
--- a/src/models.rs
+++ b/src/models.rs
@@ -170,3 +170,29 @@ pub struct Entry {
pub timestamp: Option<DateTime<Utc>>,
pub payload: Value,
}
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+pub enum Unit {
+ TimestampRfc3339,
+ Meters,
+ Seconds,
+ Unknown,
+}
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+pub struct Column {
+ field: String,
+ display_name: Option<String>,
+ unit: Unit,
+}
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+pub enum TemplateSpec {
+ Table(Vec<Column>),
+}
+
+#[derive(Debug, Serialize, Deserialize, Clone)]
+pub struct Template {
+ pub entry_type: String,
+ pub spec: TemplateSpec,
+}