diff options
author | Cara Salter <cara@devcara.com> | 2022-06-08 14:14:24 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-06-08 14:14:46 -0400 |
commit | 6a777564a4319a3809a9e2872a3eaf1cc39b8b01 (patch) | |
tree | 1020d58993cfef64abc6b4b17ccefe9bd5ec4bf6 /src | |
parent | 64db5de9920c2668488693df02baaed41ee1340d (diff) | |
download | solard-6a777564a4319a3809a9e2872a3eaf1cc39b8b01.tar.gz solard-6a777564a4319a3809a9e2872a3eaf1cc39b8b01.zip |
meta: Complete project rename
Diffstat (limited to 'src')
-rw-r--r-- | src/errors.rs | 2 | ||||
-rw-r--r-- | src/handlers/mod.rs | 2 | ||||
-rw-r--r-- | src/handlers/planets.rs (renamed from src/handlers/waifus.rs) | 10 | ||||
-rw-r--r-- | src/main.rs | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/errors.rs b/src/errors.rs index a538e4a..06a0233 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -8,7 +8,7 @@ use axum::Json; #[derive(Debug, Error)] pub enum ServiceError { #[error("Waifulib error: {0}")] - Waifulib(#[from] waifulib::errors::Error), + Solarlib(#[from] solarlib::errors::Error), #[error("Axum error: {0}")] Axum(#[from] axum::Error), diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index addf742..591f76e 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -1 +1 @@ -pub mod waifus; +pub mod planets; diff --git a/src/handlers/waifus.rs b/src/handlers/planets.rs index 117ba15..e80e7fe 100644 --- a/src/handlers/waifus.rs +++ b/src/handlers/planets.rs @@ -2,16 +2,16 @@ use axum::{response::IntoResponse, Json}; use tracing::{error, instrument}; -use waifulib::house::House; -use waifulib::waifu::Waifu; +use solarlib::star::Star; +use solarlib::planet::Planet; use crate::errors::*; -pub async fn list() -> JsonResult<Json<Vec<Waifu>>> { +pub async fn list() -> JsonResult<Json<Vec<Planet>>> { let con_url = std::env::var("QEMU_URL").unwrap_or("qemu:///system".to_string()); - let mut house: House = House::new(con_url)?; + let mut star = Star::new(con_url)?; - let inhabitants = house.inhabitants()?; + let inhabitants = star.inhabitants()?; Ok(Json(inhabitants)) } diff --git a/src/main.rs b/src/main.rs index ba319d9..8fbd0ff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,7 +32,7 @@ async fn main() { let app = Router::new() .route("/health", get(health_check)) - .route("/waifus/list", get(handlers::waifus::list)) + .route("/planets/list", get(handlers::planets::list)) .layer( ServiceBuilder::new() .layer(HandleErrorLayer::new(|error: BoxError| async move { if error.is::<tower::timeout::error::Elapsed>() { |