Skip to content

muchobien/porkbun-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust library for accessing the Porkbun API

A Porkbun API client written in 🦀.

Porkbun is a 🦀 client library for accessing the Porkbun API.

Examples

Synchronous

use porkbun_rs::{api, api::Query, auth::Auth, endpoints, Porkbun};

fn main() -> eyre::Result<()> {
    let auth = Auth::new("apikey".into(), "apisecret".into());
    let client = Porkbun::new(auth)?;
    let endpoint = endpoints::Ping::builder().build()?;

    api::ignore(endpoint).query(&client)?;

    Ok(())
}

Asynchronous

use porkbun_rs::{api, api::AsyncQuery, auth::Auth, endpoints, AsyncPorkbun};

#[tokio::main]
async fn main() -> eyre::Result<()> {
    let auth = Auth::new("apikey".into(), "apisecret".into());
    let client = AsyncPorkbun::new(auth)?;
    let endpoint = endpoints::Ping::builder().build()?;

    api::ignore(endpoint).query_async(&client).await?;

    Ok(())
}

API Documentation

LICENSE