Skip to content

Commit

Permalink
doc(blocking): add missing docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhil-prabhu committed Jan 4, 2025
1 parent 96c2c26 commit 6683212
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/blocking/providers/alibaba.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ impl Provider for Alibaba {
IDENTIFIER
}

/// Tries to identify Alibaba Cloud using all the implemented options.
#[instrument(skip_all)]
fn identify(&self, tx: SyncSender<ProviderId>, timeout: Duration) {
info!("Checking Alibaba Cloud");
Expand All @@ -36,6 +37,7 @@ impl Provider for Alibaba {
}

impl Alibaba {
/// Tries to identify Alibaba via metadata server.
#[instrument(skip_all)]
fn check_metadata_server(&self, metadata_uri: &str, timeout: Duration) -> bool {
let url = format!("{}{}", metadata_uri, METADATA_PATH);
Expand Down Expand Up @@ -66,6 +68,7 @@ impl Alibaba {
}
}

/// Tries to identify Alibaba using vendor file(s).
#[instrument(skip_all)]
fn check_vendor_file<P: AsRef<Path>>(&self, vendor_file: P) -> bool {
debug!(
Expand Down
5 changes: 5 additions & 0 deletions src/blocking/providers/aws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ impl Provider for Aws {
IDENTIFIER
}

/// Tries to identify AWS using all the implemented options.
fn identify(&self, tx: SyncSender<ProviderId>, timeout: Duration) {
info!("Checking Amazon Web Services");
if self.check_product_version_file(PRODUCT_VERSION_FILE)
Expand All @@ -49,6 +50,7 @@ impl Provider for Aws {
}

impl Aws {
/// Tries to identify AWS via metadata server (using IMDSv2).
#[instrument(skip_all)]
fn check_metadata_server_imdsv2(&self, metadata_uri: &str, timeout: Duration) -> bool {
let token_url = format!("{}{}", metadata_uri, METADATA_TOKEN_PATH);
Expand Down Expand Up @@ -111,6 +113,7 @@ impl Aws {
}
}

/// Tries to identify AWS via metadata server (using IMDSv1).
#[instrument(skip_all)]
fn check_metadata_server_imdsv1(&self, metadata_uri: &str, timeout: Duration) -> bool {
let url = format!("{}{}", metadata_uri, METADATA_PATH);
Expand Down Expand Up @@ -140,6 +143,7 @@ impl Aws {
}
}

/// Tries to identify AWS using the product version file.
#[instrument(skip_all)]
fn check_product_version_file<P: AsRef<Path>>(&self, product_version_file: P) -> bool {
debug!(
Expand All @@ -161,6 +165,7 @@ impl Aws {
false
}

/// Tries to identify AWS using the BIOS vendor file.
#[instrument(skip_all)]
fn check_bios_vendor_file<P: AsRef<Path>>(&self, bios_vendor_file: P) -> bool {
debug!(
Expand Down
3 changes: 3 additions & 0 deletions src/blocking/providers/azure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ impl Provider for Azure {
IDENTIFIER
}

/// Tries to identify Azure using all the implemented options.
#[instrument(skip_all)]
fn identify(&self, tx: SyncSender<ProviderId>, timeout: Duration) {
info!("Checking Microsoft Azure");
Expand All @@ -49,6 +50,7 @@ impl Provider for Azure {
}

impl Azure {
/// Tries to identify Azure via metadata server.
#[instrument(skip_all)]
fn check_metadata_server(&self, metadata_uri: &str, timeout: Duration) -> bool {
let url = format!("{}{}", metadata_uri, METADATA_PATH);
Expand Down Expand Up @@ -76,6 +78,7 @@ impl Azure {
}
}

/// Tries to identify Azure using vendor file(s).
#[instrument(skip_all)]
fn check_vendor_file<P: AsRef<Path>>(&self, vendor_file: P) -> bool {
debug!(
Expand Down
1 change: 1 addition & 0 deletions src/blocking/providers/digitalocean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ impl Provider for DigitalOcean {
IDENTIFIER
}

/// Tries to identify DigitalOcean using all the implemented options.
#[instrument(skip_all)]
fn identify(&self, tx: SyncSender<ProviderId>, timeout: Duration) {
info!("Checking DigitalOcean");
Expand Down
1 change: 1 addition & 0 deletions src/blocking/providers/gcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ impl Provider for Gcp {
IDENTIFIER
}

/// Tries to identify GCP using all the implemented options.
#[instrument(skip_all)]
fn identify(&self, tx: SyncSender<ProviderId>, timeout: Duration) {
info!("Checking Google Cloud Platform");
Expand Down
1 change: 1 addition & 0 deletions src/blocking/providers/oci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ impl Provider for Oci {
IDENTIFIER
}

/// Tries to identify OCI using all the implemented options.
#[instrument(skip_all)]
fn identify(&self, tx: SyncSender<ProviderId>, timeout: Duration) {
info!("Checking Oracle Cloud Infrastructure");
Expand Down

0 comments on commit 6683212

Please sign in to comment.