1 unstable release

0.1.4 Jul 21, 2022
0.1.3 Jul 21, 2022
0.1.2 Jul 20, 2022
0.1.1 Jul 19, 2022
0.1.0 Jul 18, 2022

#59 in #wait

MIT license

630KB
229 lines

PigRabbit

github docs cratesio

A rust wrapper for porkbun's api

Example

Adding a record to the domain and view all the records:

let keys_file = std::fs::read_to_string("keys.json").expect("File not found!");
let keys = serde_json::from_str(&keys_file).unwrap();
let mut client = pigrabbit::PRClient::new(keys);

let record = pigrabbit::types::Record{
    name: "internal".to_owned(),
    dtype: "A".to_owned(),
    content: "1.1.1.1".to_owned(),
    ttl: "300".to_owned()
};

client.add_record("Example.com",&record).await.unwrap();
//Wait for the remote to catch up
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
let records = client.retreive_by_domain_with_id("Example.com", "").await.unwrap();
println!("{:?}", records);

Dependencies

~4–16MB
~217K SLoC