mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-07-26 07:58:14 +00:00
Merge pull request 'k2v-client: misc fixes' (#1463) from k2v-client-clonable into main-v2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1463
This commit is contained in:
@@ -24,7 +24,7 @@ percent-encoding.workspace = true
|
|||||||
hyper = { workspace = true, default-features = false, features = ["http1", "http2"] }
|
hyper = { workspace = true, default-features = false, features = ["http1", "http2"] }
|
||||||
hyper-util.workspace = true
|
hyper-util.workspace = true
|
||||||
hyper-rustls.workspace = true
|
hyper-rustls.workspace = true
|
||||||
serde.workspace = true
|
serde = { workspace = true, default-features = false, features = ["derive", "std"] }
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ mod error;
|
|||||||
|
|
||||||
pub use error::Error;
|
pub use error::Error;
|
||||||
|
|
||||||
|
// Re-export these crates: values from these are passed to K2vClient::new_with_client
|
||||||
|
pub use hyper_rustls;
|
||||||
|
pub use hyper_util;
|
||||||
|
|
||||||
pub type Body = FullBody<Bytes>;
|
pub type Body = FullBody<Bytes>;
|
||||||
|
|
||||||
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(5);
|
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(5);
|
||||||
@@ -46,6 +50,7 @@ const PATH_ENCODE_SET: AsciiSet = NON_ALPHANUMERIC
|
|||||||
.remove(b'.')
|
.remove(b'.')
|
||||||
.remove(b'~');
|
.remove(b'~');
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
pub struct K2vClientConfig {
|
pub struct K2vClientConfig {
|
||||||
pub endpoint: String,
|
pub endpoint: String,
|
||||||
pub region: String,
|
pub region: String,
|
||||||
@@ -56,6 +61,7 @@ pub struct K2vClientConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Client used to query a K2V server.
|
/// Client used to query a K2V server.
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
pub struct K2vClient {
|
pub struct K2vClient {
|
||||||
config: K2vClientConfig,
|
config: K2vClientConfig,
|
||||||
user_agent: HeaderValue,
|
user_agent: HeaderValue,
|
||||||
|
|||||||
Reference in New Issue
Block a user