-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
730 additions
and
329 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
use smallvec::SmallVec; | ||
|
||
pub type SensAppVec<T> = SmallVec<[T; 1]>; | ||
pub type SensAppVec<T> = SmallVec<[T; 4]>; | ||
|
||
pub type SensAppLabels = SmallVec<[(String, String); 8]>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use crate::ingestors::http::app_error::AppError; | ||
use crate::ingestors::http::state::HttpServerState; | ||
use axum::extract::State; | ||
use axum::Json; | ||
|
||
/// List all the sensors. | ||
#[utoipa::path( | ||
get, | ||
path = "/sensors", | ||
tag = "SensApp", | ||
responses( | ||
(status = 200, description = "List of sensors", body = Vec<String>) | ||
) | ||
)] | ||
pub async fn list_sensors( | ||
State(state): State<HttpServerState>, | ||
) -> Result<Json<Vec<String>>, AppError> { | ||
let sensors = state.storage.list_sensors().await?; | ||
Ok(Json(sensors)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod app_error; | ||
pub mod crud; | ||
pub mod influxdb; | ||
pub mod prometheus; | ||
pub mod server; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
use crate::bus::EventBus; | ||
use crate::{bus::EventBus, storage::storage::StorageInstance}; | ||
use std::sync::Arc; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct HttpServerState { | ||
pub name: Arc<String>, | ||
pub event_bus: Arc<EventBus>, | ||
pub storage: Arc<dyn StorageInstance>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.