aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorGus Power <gus@infinitesidequests.com>2025-05-12 10:52:28 +0100
committerGus Power <gus@infinitesidequests.com>2025-05-12 10:52:28 +0100
commit1d6fd8359fddbae8aeac17b90ed50d41143ffbb6 (patch)
tree7872e1e112ea9ed440caecad9755da751de59ccd /src/main.rs
parente1f43bb48b23338ce103dc92a53a13e72021299d (diff)
skeleton dyndns service, split into ip and dyndns modules
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/main.rs b/src/main.rs
index 428ebf9..1ae22b8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,26 +1,6 @@
-use std::error::Error;
-use std::net::IpAddr;
-use std::str::FromStr;
-use reqwest::Url;
-
-#[cfg(test)]
-mod test;
+mod dyndns_service;
+mod ip_service;
fn main() {
println!("Hello, world!");
}
-
-pub struct IpService {}
-
-impl IpService {
-
- async fn resolve(config: &impl IpServiceConfiguration) -> Result<IpAddr, Box<dyn Error>> {
- let response = reqwest::get(config.get_service_url()).await.unwrap();
- Ok(IpAddr::from_str(&response.text().await.unwrap())?)
- }
-
-}
-
-pub trait IpServiceConfiguration {
- fn get_service_url(&self) -> Url;
-}