-
Notifications
You must be signed in to change notification settings - Fork 0
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
21e6db4
commit a62f04a
Showing
20 changed files
with
546 additions
and
47 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
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,11 +1,15 @@ | ||
use serde::Deserialize; | ||
|
||
use crate::{mongo_client::MongoConfig, session_token::SessionConfig}; | ||
use crate::{ | ||
session_token::SessionConfig, | ||
users_manager::{mongo_client::MongoConfig, UserRegistrationConfig}, | ||
}; | ||
|
||
#[derive(Deserialize, Debug, Clone)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct AppConfig { | ||
pub listen_address: String, | ||
pub session: SessionConfig, | ||
pub registration: UserRegistrationConfig, | ||
pub mongo: MongoConfig, | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#[derive(thiserror::Error, Debug)] | ||
pub enum Error { | ||
#[error("User is already registered")] | ||
UserAlreadyExist, | ||
#[error("User is not registered")] | ||
UserNotFound, | ||
#[error("DB comminication failure: {0}")] | ||
DbCommunicationFailure(#[from] mongodb::error::Error), | ||
#[error("Serialization error: {0}")] | ||
BsonSerialization(#[from] bson::ser::Error), | ||
#[error("Deserialization error: {0}")] | ||
BsonDeserialization(#[from] bson::de::Error), | ||
#[error("Request timeout")] | ||
Timeout(#[from] tokio::time::error::Elapsed), | ||
} |
Oops, something went wrong.