lemmy-stats-crawler/src/node_info.rs

34 lines
733 B
Rust
Raw Normal View History

2021-03-09 18:08:42 +00:00
use serde::Deserialize;
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct NodeInfo {
pub version: String,
pub software: NodeInfoSoftware,
pub protocols: Vec<String>,
pub usage: NodeInfoUsage,
pub open_registrations: bool,
2021-03-09 18:08:42 +00:00
}
#[derive(Deserialize, Debug)]
pub struct NodeInfoSoftware {
pub name: String,
pub version: String,
2021-03-09 18:08:42 +00:00
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct NodeInfoUsage {
pub users: NodeInfoUsers,
pub local_posts: i64,
pub local_comments: i64,
2021-03-09 18:08:42 +00:00
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct NodeInfoUsers {
pub total: i64,
pub active_halfyear: i64,
pub active_month: i64,
}