-
Notifications
You must be signed in to change notification settings - Fork 4
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
Showing
39 changed files
with
304 additions
and
4,918 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = ["src/public"] | ||
members = [ | ||
"src/public", | ||
] |
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,4 @@ | ||
POSTGRES_DIR="./library/src/adapter/repositories/postgres" | ||
POSTGRES_DIR="./src/adapter/src/repositories/postgres" | ||
DATABASE_URL="postgres://postgres:[email protected]:5432/postgres" | ||
|
||
PKG_NAME=rust-api-server | ||
|
@@ -35,5 +35,5 @@ build: | |
build-dev: | ||
BUILDKIT_PROGRESS=plain DOCKER_BUILDKIT=1 docker build --ssh default -t $(PKG_NAME):$(BUILD_VERSION) --target=dev . | ||
|
||
profiling: | ||
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --root -- -c ./config/* -c deploy/local/custom.toml | ||
profiling-public: | ||
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --root -- -c ./src/public/config/* -c ./deploy/local/custom.toml |
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,2 +1,3 @@ | ||
pub mod in_memory; | ||
pub mod postgres; | ||
pub mod repository_test; |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
pub mod id; | ||
pub mod question; |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "common" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
serde = { version = "1.0", features = ["derive"] } | ||
opentelemetry-semantic-conventions = { version = "0.14.0" } | ||
config = "0.14.0" | ||
glob = "0.3.1" | ||
tracing = "0.1" | ||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } | ||
tracing-opentelemetry = "0.23.0" | ||
tracing-bunyan-formatter = "0.3.9" | ||
opentelemetry = { version = "0.22.0" } | ||
opentelemetry_sdk = { version = "0.22.1", features = ["rt-tokio"] } | ||
opentelemetry-otlp = { version = "0.15.0", features = ["tonic"] } |
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,2 @@ | ||
pub mod loggers; | ||
pub mod options; |
File renamed without changes.
File renamed without changes.
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,43 @@ | ||
use config::ConfigError::Message; | ||
use config::{Config, ConfigError, Environment, File}; | ||
use glob::glob; | ||
use serde::Deserialize; | ||
|
||
pub fn parse_options<'de, T: Deserialize<'de>>( | ||
config_paths: Vec<String>, | ||
) -> Result<T, ConfigError> { | ||
let mut config = Config::builder(); | ||
|
||
for path in &config_paths { | ||
let paths = glob(path).map_err(|e| Message(e.to_string()))?; | ||
for entry in paths { | ||
let entry = entry.map_err(|e| Message(e.to_string()))?; | ||
config = config.add_source(File::from(entry)); | ||
} | ||
} | ||
|
||
let config = config | ||
.add_source( | ||
Environment::default() | ||
.separator("__") | ||
.list_separator(",") | ||
.ignore_empty(true), | ||
) | ||
.build()?; | ||
|
||
config.try_deserialize() | ||
} | ||
|
||
/// Represents logging configuration. | ||
#[derive(Debug, Deserialize, Clone)] | ||
pub struct Log { | ||
/// Log level. | ||
pub level: String, | ||
} | ||
|
||
/// Default logging configuration. | ||
pub fn default_log() -> Log { | ||
Log { | ||
level: "INFO".to_string(), | ||
} | ||
} |
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 @@ | ||
[package] | ||
name = "rust-core" | ||
name = "rust_core" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
|
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
Oops, something went wrong.