diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/error.rs | 1 | ||||
-rw-r--r-- | src/models.rs | 26 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs index 22ff600..166005d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,5 +1,4 @@ use bcrypt::BcryptError; -use chrono::format::ParseResult; use diesel::result::Error as DieselErr; use serde_json::Value; use std::convert::From; 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, +} |