gandi-live-dns-rust/src/ip_source/ip_source.rs
jannikac 8413555d2f
Implement thiserror and improve output formatting (#91)
* implemented an error struct with all possible errors using thiserror

* Replaced die_with with ClientError enum derived with thiserror.
This enables prettier and more structured error handling than anyhow

* Added proper parsing of Gandi API Responses.
This also makes it possible to output prettier logs.

* improved error message

* anyhow is better for main fn because it outputs anyhow errors correctly
2023-02-10 22:08:54 -05:00

10 lines
216 B
Rust

use async_trait::async_trait;
use crate::ClientError;
#[async_trait]
pub trait IPSource {
async fn get_ipv4(&self) -> Result<String, ClientError>;
async fn get_ipv6(&self) -> Result<String, ClientError>;
}