Crates.io | pigrabbit |
lib.rs | pigrabbit |
version | 0.1.4 |
source | src |
created_at | 2022-07-18 07:40:16.693509 |
updated_at | 2022-07-21 08:01:51.355201 |
description | Porkbun api wrapper for rust |
homepage | |
repository | |
max_upload_size | |
id | 627580 |
size | 631,477 |
A rust wrapper for porkbun's api
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);