duckdns

Crates.ioduckdns
lib.rsduckdns
version0.1.1
sourcesrc
created_at2018-02-26 18:49:40.302549
updated_at2018-02-26 19:42:18.620003
descriptionDuckDNS client library
homepage
repositoryhttps://gitlab.com/imp/duckdns-rs.git
max_upload_size
id52945
size21,023
Cyril Plisko (imp)

documentation

https://docs.rs/duckdns

README

duckdns-rs - DuckDNS client

Usage is pretty simple. All you need is instantiate new DuckDns object with your token and add domains. Then call update()

extern crate dotenv;
extern crate duckdns;

use duckdns::DuckDns;

fn main() {
    let token = dotenv::var("DUCKDNS_TOKEN").unwrap();
    duckdns::DuckDns::new(token).domains("mydomain").update();
}

In addition you may choose to specify an IP address, rather than let duckdns use the source of your request.

extern crate dotenv;
extern crate duckdns;

use duckdns::DuckDns;

fn main() {
    let token = dotenv::var("DUCKDNS_TOKEN").unwrap();
    duckdns::DuckDns::new(token).domains("mydomain").ipv4("192.168.123.234").update();
}

If you have IpAddr object you can use it directly

extern crate dotenv;
extern crate duckdns;

use duckdns::DuckDns;

fn main() {
    let token = dotenv::var("DUCKDNS_TOKEN").unwrap();
    let addr = "8.8.8.8".parse().unwrap();
    duckdns::DuckDns::new(token).domains("mydomain").ip(addr).update();
}
Commit count: 15

cargo fmt