Skip to content

Commit

Permalink
Merge pull request #750 from Gor027/public_cloud_config
Browse files Browse the repository at this point in the history
Make `CloudConfig` public
  • Loading branch information
piodul authored Jun 30, 2023
2 parents d9f3b92 + 30a24d4 commit f3d41c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion scylla/src/cloud/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ pub enum CloudConfigError {
Ssl(#[from] openssl::error::ErrorStack),
}

/// Configuration for creating a session to a serverless cluster.
/// This can be automatically created if you provide the bundle path
/// to the [`CloudSessionBuilder`] constructor.
#[derive(Debug)]
pub(crate) struct CloudConfig {
pub struct CloudConfig {
datacenters: HashMap<String, Datacenter>,
auth_infos: HashMap<String, AuthInfo>,

Expand Down Expand Up @@ -67,6 +70,8 @@ impl CloudConfig {
}
}

/// Contains all authentication info for creating TLS connections using SNI proxy
/// to connect to cloud nodes.
#[derive(Debug)]
pub(crate) struct AuthInfo {
key: PKey<Private>,
Expand Down Expand Up @@ -97,6 +102,7 @@ impl AuthInfo {
}
}

/// Contains cloud datacenter configuration for creating TLS connections to its nodes.
#[derive(Debug)]
pub(crate) struct Datacenter {
certificate_authority: X509,
Expand Down Expand Up @@ -137,6 +143,7 @@ impl Datacenter {
}
}

/// Contains the names of the primary datacenter and authentication info.
#[derive(Debug)]
pub(crate) struct Context {
datacenter_name: String,
Expand Down
4 changes: 2 additions & 2 deletions scylla/src/transport/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ pub struct SessionConfig {
/// It is true by default but can be disabled if successive schema-altering statements should be performed.
pub refresh_metadata_on_auto_schema_agreement: bool,

// If the driver is to connect to ScyllaCloud, there is a config for it.
/// If the driver is to connect to ScyllaCloud, there is a config for it.
#[cfg(feature = "cloud")]
pub(crate) cloud_config: Option<Arc<CloudConfig>>,
pub cloud_config: Option<Arc<CloudConfig>>,

/// If true, the driver will inject a small delay before flushing data
/// to the socket - by rescheduling the task that writes data to the socket.
Expand Down

0 comments on commit f3d41c9

Please sign in to comment.