Skip to content

Commit

Permalink
Document default value of InstanceCredentialProvider (#5188)
Browse files Browse the repository at this point in the history
* Document default value of InstanceCredentialProvider

* Move docs to credentials field rather than crate-private method

* Review feedback

* Tweak doctest

---------

Co-authored-by: Raphael Taylor-Davies <r.taylordavies@googlemail.com>
  • Loading branch information
justinabrahms and tustvold authored Dec 23, 2023
1 parent 72c9505 commit c6f8bb5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions object_store/src/gcp/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,16 @@ impl From<Error> for crate::Error {
}
}

/// Configure a connection to Google Cloud Storage using the specified
/// credentials.
/// Configure a connection to Google Cloud Storage.
///
/// If no credentials are explicitly provided, they will be sourced
/// from the environment as documented [here](https://cloud.google.com/docs/authentication/application-default-credentials).
///
/// # Example
/// ```
/// # let BUCKET_NAME = "foo";
/// # let SERVICE_ACCOUNT_PATH = "/tmp/foo.json";
/// # use object_store::gcp::GoogleCloudStorageBuilder;
/// let gcs = GoogleCloudStorageBuilder::new()
/// .with_service_account_path(SERVICE_ACCOUNT_PATH)
/// .with_bucket_name(BUCKET_NAME)
/// .build();
/// let gcs = GoogleCloudStorageBuilder::from_env().with_bucket_name(BUCKET_NAME).build();
/// ```
#[derive(Debug, Clone)]
pub struct GoogleCloudStorageBuilder {
Expand Down

0 comments on commit c6f8bb5

Please sign in to comment.