mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-20 15:38:11 -07:00
global: snapshot
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user