global: snapshot

This commit is contained in:
nym21
2025-10-11 18:17:36 +02:00
parent bb46481d7f
commit 5f87594ead
20 changed files with 255 additions and 396 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ use serde::Serialize;
#[derive(Debug, Serialize, JsonSchema)]
/// Server health status
pub struct Health {
pub status: String,
pub service: String,
pub status: &'static str,
pub service: &'static str,
pub timestamp: String,
}
+2
View File
@@ -36,6 +36,7 @@ mod loadedaddressdata;
mod loadedaddressindex;
mod metriccount;
mod metricpath;
mod metricsearchquery;
mod monthindex;
mod ohlc;
mod opreturnindex;
@@ -116,6 +117,7 @@ pub use loadedaddressdata::*;
pub use loadedaddressindex::*;
pub use metriccount::*;
pub use metricpath::*;
pub use metricsearchquery::*;
pub use monthindex::*;
pub use ohlc::*;
pub use opreturnindex::*;
@@ -0,0 +1,26 @@
use schemars::JsonSchema;
use serde::Deserialize;
#[derive(Debug, Deserialize, JsonSchema)]
/// Search query parameters for finding metrics by name
pub struct MetricSearchQuery {
/// Search query string. Supports fuzzy matching, partial matches, and typos.
#[schemars(example = &"price", example = &"low", example = &"sth", example = &"realized", example = &"pric")]
pub q: String,
/// Maximum number of results to return. Defaults to 100 if not specified.
#[serde(default = "default_search_limit")]
#[schemars(
example = "1",
example = "10",
example = "100",
example = "1000",
example = "10000",
example = "100000"
)]
pub limit: usize,
}
fn default_search_limit() -> usize {
100
}