forked from mirror/reqwest-middleware
chore: Move to task-local-extensions (#9)
* chore: Move to task-local-extensionsreqwest-tracing-0.2
parent
b8645f81eb
commit
9c82a35a90
|
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Disabled default features on `reqwest`
|
- Disabled default features on `reqwest`
|
||||||
|
- Replaced `truelayer-extensions` with `task-local-extensions`
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- New methods on `ClientWithExtensions` and `RequestBuilder` for sending requests with initial extensions.
|
- New methods on `ClientWithExtensions` and `RequestBuilder` for sending requests with initial extensions.
|
||||||
|
|
|
@ -18,7 +18,7 @@ http = "0.2"
|
||||||
reqwest = { version = "0.11", default-features = false, features = ["json", "multipart"] }
|
reqwest = { version = "0.11", default-features = false, features = ["json", "multipart"] }
|
||||||
serde = "1"
|
serde = "1"
|
||||||
thiserror = "1"
|
thiserror = "1"
|
||||||
truelayer-extensions = "0.1"
|
task-local-extensions = "0.1.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
reqwest = "0.11"
|
reqwest = "0.11"
|
||||||
|
|
|
@ -6,7 +6,7 @@ use std::convert::TryFrom;
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use truelayer_extensions::Extensions;
|
use task_local_extensions::Extensions;
|
||||||
|
|
||||||
use crate::error::Result;
|
use crate::error::Result;
|
||||||
use crate::middleware::{Middleware, Next};
|
use crate::middleware::{Middleware, Next};
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//! ```
|
//! ```
|
||||||
//! use reqwest::{Client, Request, Response};
|
//! use reqwest::{Client, Request, Response};
|
||||||
//! use reqwest_middleware::{ClientBuilder, Middleware, Next, Result};
|
//! use reqwest_middleware::{ClientBuilder, Middleware, Next, Result};
|
||||||
//! use truelayer_extensions::Extensions;
|
//! use task_local_extensions::Extensions;
|
||||||
//!
|
//!
|
||||||
//! struct LoggingMiddleware;
|
//! struct LoggingMiddleware;
|
||||||
//!
|
//!
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use futures::future::{BoxFuture, FutureExt, TryFutureExt};
|
use futures::future::{BoxFuture, FutureExt, TryFutureExt};
|
||||||
use reqwest::{Client, Request, Response};
|
use reqwest::{Client, Request, Response};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use truelayer_extensions::Extensions;
|
use task_local_extensions::Extensions;
|
||||||
|
|
||||||
use crate::error::{Error, Result};
|
use crate::error::{Error, Result};
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ use crate::error::{Error, Result};
|
||||||
/// ```
|
/// ```
|
||||||
/// use reqwest::{Client, Request, Response};
|
/// use reqwest::{Client, Request, Response};
|
||||||
/// use reqwest_middleware::{ClientBuilder, Middleware, Next, Result};
|
/// use reqwest_middleware::{ClientBuilder, Middleware, Next, Result};
|
||||||
/// use truelayer_extensions::Extensions;
|
/// use task_local_extensions::Extensions;
|
||||||
///
|
///
|
||||||
/// struct TransparentMiddleware;
|
/// struct TransparentMiddleware;
|
||||||
///
|
///
|
||||||
|
|
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Re-export `RetryPolicy` from the crate root.
|
- Re-export `RetryPolicy` from the crate root.
|
||||||
### Changed
|
### Changed
|
||||||
- Disabled default features on `reqwest`
|
- Disabled default features on `reqwest`
|
||||||
|
- Replaced `truelayer-extensions` with `task-local-extensions`
|
||||||
|
|
||||||
## [0.1.1] - 2021-09-15
|
## [0.1.1] - 2021-09-15
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -21,7 +21,7 @@ retry-policies = "0.1"
|
||||||
reqwest = { version = "0.11", default-features = false }
|
reqwest = { version = "0.11", default-features = false }
|
||||||
tokio = { version = "1.6", features = ["time"] }
|
tokio = { version = "1.6", features = ["time"] }
|
||||||
tracing = "0.1.26"
|
tracing = "0.1.26"
|
||||||
truelayer-extensions = "0.1"
|
task-local-extensions = "0.1.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
wiremock = "0.5"
|
wiremock = "0.5"
|
||||||
|
|
|
@ -6,7 +6,7 @@ use chrono::Utc;
|
||||||
use reqwest::{Request, Response};
|
use reqwest::{Request, Response};
|
||||||
use reqwest_middleware::{Error, Middleware, Next, Result};
|
use reqwest_middleware::{Error, Middleware, Next, Result};
|
||||||
use retry_policies::RetryPolicy;
|
use retry_policies::RetryPolicy;
|
||||||
use truelayer_extensions::Extensions;
|
use task_local_extensions::Extensions;
|
||||||
|
|
||||||
/// We limit the number of retries to a maximum of `10` to avoid stack-overflow issues due to the recursion.
|
/// We limit the number of retries to a maximum of `10` to avoid stack-overflow issues due to the recursion.
|
||||||
static MAXIMUM_NUMBER_OF_RETRIES: u32 = 10;
|
static MAXIMUM_NUMBER_OF_RETRIES: u32 = 10;
|
||||||
|
|
|
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Disabled default features on `reqwest`
|
- Disabled default features on `reqwest`
|
||||||
|
- Replaced `truelayer-extensions` with `task-local-extensions`
|
||||||
|
|
||||||
## [0.1.2] - 2021-09-15
|
## [0.1.2] - 2021-09-15
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -22,7 +22,7 @@ async-trait = "0.1.51"
|
||||||
reqwest = { version = "0.11", default-features = false }
|
reqwest = { version = "0.11", default-features = false }
|
||||||
tokio = { version = "1.6", features = ["time"] }
|
tokio = { version = "1.6", features = ["time"] }
|
||||||
tracing = "0.1.26"
|
tracing = "0.1.26"
|
||||||
truelayer-extensions = "0.1"
|
task-local-extensions = "0.1.1"
|
||||||
|
|
||||||
opentelemetry_0_13_pkg = { package = "opentelemetry", version = "0.13", optional = true }
|
opentelemetry_0_13_pkg = { package = "opentelemetry", version = "0.13", optional = true }
|
||||||
opentelemetry_0_14_pkg = { package = "opentelemetry", version = "0.14", optional = true }
|
opentelemetry_0_14_pkg = { package = "opentelemetry", version = "0.14", optional = true }
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use reqwest::header::{HeaderMap, HeaderValue};
|
use reqwest::header::{HeaderMap, HeaderValue};
|
||||||
use reqwest::{Request, Response, StatusCode as RequestStatusCode};
|
use reqwest::{Request, Response, StatusCode as RequestStatusCode};
|
||||||
use reqwest_middleware::{Error, Middleware, Next, Result};
|
use reqwest_middleware::{Error, Middleware, Next, Result};
|
||||||
use truelayer_extensions::Extensions;
|
use task_local_extensions::Extensions;
|
||||||
|
|
||||||
/// Middleware for tracing requests using the current Opentelemetry Context.
|
/// Middleware for tracing requests using the current Opentelemetry Context.
|
||||||
pub struct TracingMiddleware;
|
pub struct TracingMiddleware;
|
||||||
|
|
Loading…
Reference in New Issue