pigrabbit

Crates.iopigrabbit
lib.rspigrabbit
version0.1.4
sourcesrc
created_at2022-07-18 07:40:16.693509
updated_at2022-07-21 08:01:51.355201
descriptionPorkbun api wrapper for rust
homepage
repository
max_upload_size
id627580
size631,477
Fishappy0 (fishappy0)

documentation

README

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);

Commit count: 0

cargo fmt