Proxy: value: handle i64/f64/string

Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
This commit is contained in:
Frank Villaro-Dixon 2024-05-24 23:54:11 +02:00
parent 0c96891a46
commit dcce9113d1

View file

@ -19,11 +19,19 @@ struct QSParams {
token: String, token: String,
} }
#[derive(Debug, Deserialize, Serialize)]
#[serde(untagged)]
enum OtsdbValue {
String(String),
Integer(i64),
Float(f64),
}
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]
struct OtsdbData { struct OtsdbData {
metric: String, metric: String,
value: String, value: OtsdbValue,
timestamp: f64, timestamp: i64,
tags: HashMap<String, String>, tags: HashMap<String, String>,
} }