node_discover/providers/
mod.rs

1#[cfg(feature = "aws")]
2pub mod aws;
3#[cfg(feature = "digitalocean")]
4pub mod digitalocean;
5
6use std::convert::TryFrom;
7
8use crate::{args::ParsedArgs, errors::DiscoverError};
9
10#[async_trait::async_trait]
11pub trait Provider: TryFrom<ParsedArgs> + Send + Sync {
12    /// Retrieve IP addresses of nodes in this provider.
13    async fn addrs(&self) -> Result<Vec<String>, DiscoverError>;
14    /// Returns text explaining how to use this provider.
15    ///
16    /// That means which attributes are available and what the value of those
17    /// attributes can be. Any other information that the user of this
18    /// provider needs to know should also be explained.
19    fn help() -> &'static str;
20}