This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new c0444642b object_store: Export `ClientConfigKey` and add
`HttpBuilder::with_config` (#4516)
c0444642b is described below
commit c0444642b4a5f60a6621497d1de3316442c77d3b
Author: Ahmad Sattar <[email protected]>
AuthorDate: Thu Jul 13 18:58:41 2023 +0200
object_store: Export `ClientConfigKey` and add `HttpBuilder::with_config`
(#4516)
* object_store: Export `ClientConfigKey`
* object_store: Add `HttpBuilder::with_config`
---
object_store/src/http/mod.rs | 10 ++++++++--
object_store/src/lib.rs | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/object_store/src/http/mod.rs b/object_store/src/http/mod.rs
index 124b7da2f..bc01c174f 100644
--- a/object_store/src/http/mod.rs
+++ b/object_store/src/http/mod.rs
@@ -43,8 +43,8 @@ use url::Url;
use crate::http::client::Client;
use crate::path::Path;
use crate::{
- ClientOptions, GetOptions, GetResult, ListResult, MultipartId, ObjectMeta,
- ObjectStore, Result, RetryConfig,
+ ClientConfigKey, ClientOptions, GetOptions, GetResult, ListResult,
MultipartId,
+ ObjectMeta, ObjectStore, Result, RetryConfig,
};
mod client;
@@ -231,6 +231,12 @@ impl HttpBuilder {
self
}
+ /// Set individual client configuration without overriding the entire
config
+ pub fn with_config(mut self, key: ClientConfigKey, value: impl
Into<String>) -> Self {
+ self.client_options = self.client_options.with_config(key, value);
+ self
+ }
+
/// Sets the client options, overriding any already set
pub fn with_client_options(mut self, options: ClientOptions) -> Self {
self.client_options = options;
diff --git a/object_store/src/lib.rs b/object_store/src/lib.rs
index 97e6aae97..4867d485d 100644
--- a/object_store/src/lib.rs
+++ b/object_store/src/lib.rs
@@ -274,7 +274,7 @@ use std::sync::Arc;
use tokio::io::AsyncWrite;
#[cfg(any(feature = "azure", feature = "aws", feature = "gcp", feature =
"http"))]
-pub use client::ClientOptions;
+pub use client::{ClientConfigKey, ClientOptions};
/// An alias for a dynamically dispatched object store implementation.
pub type DynObjectStore = dyn ObjectStore;