All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
22 lines
517 B
Rust
22 lines
517 B
Rust
use crate::api::Discovery;
|
|
|
|
pub struct DiscoveryClient {
|
|
host: String,
|
|
}
|
|
|
|
impl DiscoveryClient {
|
|
pub fn new(discovery_host: impl Into<String>) -> Self {
|
|
Self {
|
|
host: discovery_host.into(),
|
|
}
|
|
}
|
|
|
|
pub async fn discover(&self) -> anyhow::Result<Discovery> {
|
|
tracing::info!(
|
|
"getting details from discovery endpoint: {}/discovery",
|
|
self.host.trim_end_matches('/')
|
|
);
|
|
crate::api::Discovery::get_from_host(&self.host).await
|
|
}
|
|
}
|