1个不稳定版本
0.1.0 | 2021年6月4日 |
---|
#440 in HTTP客户端
50KB
1.5K SLoC
Rust库,用于访问Porkbun API
用🦀编写的Porkbun API客户端。
Porkbun 是一个用于访问Porkbun API的🦀客户端库。
示例
同步
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(())
}
异步
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文档
许可证
依赖
~4–16MB
~239K SLoC