2021-03-09 18:08:42 +00:00
|
|
|
use serde::Deserialize;
|
|
|
|
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct NodeInfo {
|
2021-03-09 18:45:49 +00:00
|
|
|
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 {
|
2021-03-09 18:45:49 +00:00
|
|
|
pub name: String,
|
|
|
|
pub version: String,
|
2021-03-09 18:08:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Deserialize, Debug)]
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
pub struct NodeInfoUsage {
|
2021-03-09 18:45:49 +00:00
|
|
|
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 {
|
2021-03-09 18:45:49 +00:00
|
|
|
pub total: i64,
|
|
|
|
pub active_halfyear: i64,
|
|
|
|
pub active_month: i64,
|
|
|
|
}
|