Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
feat: remove errors crate
Browse files Browse the repository at this point in the history
  • Loading branch information
ralvescosta committed Feb 21, 2023
1 parent da08ac9 commit 7bd61d9
Show file tree
Hide file tree
Showing 65 changed files with 103 additions and 180 deletions.
83 changes: 38 additions & 45 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
members = [
"amqp",
"env",
"errors",
"health_readiness",
"httpw",
"logging",
Expand Down
2 changes: 1 addition & 1 deletion amqp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition = "2021"
mocks = ["dep:mockall"]

[dependencies]
errors = { path = "../errors" }
env = { path = "../env" }
traces = { path = "../traces" }

Expand All @@ -20,6 +19,7 @@ serde_json = { version = "1.0.91" }
serde = { version = "1.0.152", features = ["derive"] }
tokio = { version = "1.25.0", features = ["default"] }
futures-util = { version = "0.3.26"}
thiserror = { version = "1.0.38" }

# Used only with feature mock
mockall = { version = "0.11.3", optional = true }
Expand Down
4 changes: 1 addition & 3 deletions amqp/src/client.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use crate::types::PublishParams;

use super::{
defs,
topology::ExchangeKind as MyExchangeKind,
types::{AmqpPayload, AmqpTracePropagator},
};
use crate::{errors::AmqpError, types::PublishParams};
use async_trait::async_trait;
use env::{Configs, DynamicConfig};
use errors::amqp::AmqpError;
use lapin::{
message::BasicGetMessage,
options::{
Expand Down
2 changes: 1 addition & 1 deletion amqp/src/consumer.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::{
client::Amqp,
errors::AmqpError,
topology::{ConsumerHandler, QueueDefinition},
types::{new_span, Metadata},
};
use errors::amqp::AmqpError;
use lapin::{
message::Delivery,
options::{BasicAckOptions, BasicNackOptions, BasicPublishOptions},
Expand Down
2 changes: 1 addition & 1 deletion amqp/src/dispatcher.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::{
client::Amqp,
consumer::consume,
errors::AmqpError,
topology::{ConsumerHandler, QueueDefinition},
};
use errors::amqp::AmqpError;
use futures_util::{future::join_all, StreamExt};
use opentelemetry::global;
use std::sync::Arc;
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions amqp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ mod consumer;
pub mod client;
pub mod defs;
pub mod dispatcher;
pub mod errors;
#[cfg(test)]
pub mod mocks;
#[cfg(feature = "mocks")]
Expand Down
3 changes: 1 addition & 2 deletions amqp/src/mocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use super::{
topology::ExchangeKind as MyExchangeKind,
types::{AmqpPayload, PublishParams},
};
use crate::client::Amqp;
use crate::{client::Amqp, errors::AmqpError};
use async_trait::async_trait;
use errors::amqp::AmqpError;
use lapin::{
message::BasicGetMessage,
types::{AMQPValue, FieldTable, ShortString},
Expand Down
6 changes: 2 additions & 4 deletions amqp/src/topology.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::{collections::BTreeMap, sync::Arc};

use crate::{client::Amqp, defs};
use crate::{client::Amqp, defs, errors::AmqpError};
use async_trait::async_trait;
use errors::amqp::AmqpError;
use lapin::types::{AMQPValue, FieldTable, LongInt, LongString, ShortString};
use opentelemetry::Context;
use std::{collections::BTreeMap, sync::Arc};
use tracing::debug;

#[derive(Debug, Clone, Default)]
Expand Down
2 changes: 1 addition & 1 deletion amqp/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::defs;
use errors::amqp::AmqpError;
use crate::errors::AmqpError;
use lapin::{
protocol::basic::AMQPProperties,
types::{AMQPValue, FieldTable, LongInt, ShortString},
Expand Down
3 changes: 0 additions & 3 deletions auth/src/defs.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
pub enum UsersScopes {}

pub enum ThingsScopes {}

pub enum PlatformScopes {}

pub enum Scopes {
USER(UsersScopes),
THING(ThingsScopes),
PLATFORM(PlatformScopes),
}
2 changes: 1 addition & 1 deletion auth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ mod defs;
pub mod jwt_manager;
mod types;

pub use defs::{PlatformScopes, Scopes, ThingsScopes, UsersScopes};
pub use defs::{PlatformScopes, Scopes, UsersScopes};
Loading

0 comments on commit 7bd61d9

Please sign in to comment.