-
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.
Merge pull request #14 from leirn/mongodb_backend
Mongodb backend
- Loading branch information
Showing
16 changed files
with
2,316 additions
and
323 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
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,11 @@ | ||
http: | ||
host: 127.0.0.1 | ||
port: 8080 | ||
security: | ||
auth_tokens: | ||
- aaaa | ||
- bbbb | ||
- cccc | ||
database: | ||
backend : MONGODB # can be either SQLITE or MONGODB | ||
path : mongodb://localhost:27017 # Mongo URI if mongo (mandatory. Path to sqlite file if sqlite. If sqlite and no path, memory is used |
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,27 @@ | ||
use serde::Deserialize; | ||
|
||
use super::db::BackendType; | ||
|
||
#[derive(Debug, Deserialize, Default)] | ||
pub struct Config { | ||
pub http: HttpConfig, | ||
pub security: SecurityConfig, | ||
pub database: DatabaseConfig, | ||
} | ||
|
||
#[derive(Debug, Deserialize, Default)] | ||
pub struct HttpConfig { | ||
pub host: String, | ||
pub port: u16, | ||
} | ||
|
||
#[derive(Debug, Deserialize, Default)] | ||
pub struct SecurityConfig { | ||
pub auth_tokens: Vec<String>, | ||
} | ||
|
||
#[derive(Debug, Deserialize, Default)] | ||
pub struct DatabaseConfig { | ||
pub backend: BackendType, | ||
pub path: Option<String>, | ||
} |
Oops, something went wrong.