digitalocean-rs

A pure Rust digitalocean API binding

6 releases

0.1.9 Nov 6, 2023
0.1.8 Nov 5, 2023

#611 in Development tools

Download history 14/week @ 2024-06-14 18/week @ 2024-06-21 22/week @ 2024-06-28 43/week @ 2024-07-05 66/week @ 2024-07-12 20/week @ 2024-07-19 75/week @ 2024-07-26 19/week @ 2024-08-02 12/week @ 2024-08-09 14/week @ 2024-08-16 8/week @ 2024-08-23 12/week @ 2024-08-30 12/week @ 2024-09-06 14/week @ 2024-09-13 82/week @ 2024-09-20 49/week @ 2024-09-27

158 downloads per month

MIT license

32KB
719 lines

digitalocean-rs

A pure Rust DigitalOcean API binding.

Examples

Example blocking

It needs to have the feature "blocking" enabled.

digitalocean-rs = { version = "*", features = ["blocking"] }
use digitalocean_rs::DigitalOceanApi;
use digitalocean_rs::DigitalOceanError;

fn main() -> Result<(), DigitalOceanError> {
    let api = DigitalOceanApi::new("api key");

    let images = api.list_images()?;
    println!("IMAGES: {:#?}", images);

    let sizes = api.list_sizes()?;
    println!("SIZES: {:#?}", sizes);
    Ok(())
}

Example async

digitalocean-rs = { version = "*" }
use digitalocean_rs::DigitalOceanApi;
use digitalocean_rs::DigitalOceanError;

#[async_std::main]
async fn main() -> Result<(), DigitalOceanError> {
    let api = DigitalOceanApi::new("api key");

    let images = api.list_images_async().await?;
    println!("IMAGES: {:#?}", images);

    let sizes = api.list_sizes_async().await?;
    println!("SIZES: {:#?}", sizes);

    Ok(())
}

Features

  • "default" - use nativetls
  • "default-rustls" - use rusttls
  • "blocking" - enable blocking api
  • "rustls" - enable rustls for reqwest
  • "nativetls" - add support for nativetls DEFAULT
  • "gzip" - enable gzip in reqwest
  • "brotli" - enable brotli in reqwest
  • "deflate" - enable deflate in reqwest

TODO

  • Documentation
  • Full api support

Dependencies

~4–18MB
~307K SLoC