-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26f4e98
commit f74c9c2
Showing
51 changed files
with
1,297 additions
and
1,221 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,30 +1,12 @@ | ||
use std::sync::Arc; | ||
|
||
use axum::{routing::get, Router}; | ||
use iris_client::IrisClient; | ||
use ris_client::RisClient; | ||
use axum::{Router, routing::get}; | ||
|
||
use crate::cache::{self, RedisCache}; | ||
use crate::SharedState; | ||
|
||
pub mod station_board; | ||
|
||
#[derive(Clone)] | ||
pub struct CustomEndpointState { | ||
iris_client: Arc<IrisClient>, | ||
ris_client: Arc<RisClient>, | ||
cache: Arc<RedisCache>, | ||
} | ||
|
||
pub fn router(redis: Arc<redis::Client>, db_client_id: &str, db_api_key: &str) -> Router { | ||
let ris_client = Arc::new(RisClient::new(None, None, None, db_client_id, db_api_key)); | ||
|
||
let shared_state = Arc::new(CustomEndpointState { | ||
iris_client: Arc::new(IrisClient::default()), | ||
ris_client, | ||
cache: Arc::new(cache::RedisCache::new(redis)), | ||
}); | ||
|
||
pub fn router() -> Router<Arc<SharedState>> { | ||
Router::new() | ||
.route("/station_board/:id", get(station_board::station_board)) | ||
.with_state(shared_state) | ||
} |
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,27 +1,12 @@ | ||
use std::sync::Arc; | ||
|
||
use axum::{routing::get, Router}; | ||
use iris_client::IrisClient; | ||
use axum::{Router, routing::get}; | ||
|
||
use crate::cache::{self, RedisCache}; | ||
use crate::SharedState; | ||
|
||
pub mod station_board; | ||
|
||
#[derive(Clone)] | ||
pub struct IrisState { | ||
iris_client: Arc<IrisClient>, | ||
cache: Arc<RedisCache>, | ||
} | ||
|
||
pub fn router(redis: Arc<redis::Client>) -> Router { | ||
let iris_client = Arc::new(IrisClient::default()); | ||
|
||
let shared_state = Arc::new(IrisState { | ||
iris_client, | ||
cache: Arc::new(cache::RedisCache::new(redis)), | ||
}); | ||
|
||
pub fn router() -> Router<Arc<SharedState>> { | ||
Router::new() | ||
.route("/station_board/:id", get(station_board::station_board)) | ||
.with_state(shared_state) | ||
} |
Oops, something went wrong.