Proxy: value: handle i64/f64/string
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
This commit is contained in:
parent
0c96891a46
commit
dcce9113d1
1 changed files with 10 additions and 2 deletions
12
src/main.rs
12
src/main.rs
|
@ -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>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue