borrowed strings without ownership (almost everywhere)
parent
442c937e06
commit
83f5dd472c
|
|
@ -1,25 +1,28 @@
|
|||
// use std::collections::HashMap;
|
||||
use serde::{Serialize, Deserialize};
|
||||
use serde_json::Value;
|
||||
use std::borrow::Cow;
|
||||
// use anyhow::Result;
|
||||
// use std::sync::Arc;
|
||||
|
||||
pub mod v3 {
|
||||
pub use super::*;
|
||||
// to prometheus and nmns
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct MetricOutput {
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct MetricOutput<'a> {
|
||||
pub id : String,
|
||||
#[serde(rename = "type")]
|
||||
json_type : String,
|
||||
addr : String,
|
||||
pub value : Value,
|
||||
#[serde(rename = "description")]
|
||||
pub desc : Option<Cow<'a, String>>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct PrometheusMetrics {
|
||||
pub struct PrometheusMetrics<'a> {
|
||||
pub service_name: String,
|
||||
pub endpoint_name: String,
|
||||
pub metrics: Vec<MetricOutput>,
|
||||
pub metrics: Vec<MetricOutput<'a>>,
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue