#azure-blob #azure-storage #storage-api #microsoft-azure #remi

remi-azure

๐Ÿปโ€โ„๏ธ๐Ÿงถ Support of Microsoft's Azure Blob Storage with remi-rs primitives

13 releases (5 breaking)

new 0.10.1 Jan 13, 2025
0.10.0 Dec 4, 2024
0.9.1 Oct 21, 2024
0.8.1 Oct 17, 2024
0.5.0 Jan 15, 2024

#1126 in Network programming

Download history 95/week @ 2024-09-23 104/week @ 2024-09-30 24/week @ 2024-10-07 370/week @ 2024-10-14 428/week @ 2024-10-21 30/week @ 2024-10-28 137/week @ 2024-11-04 77/week @ 2024-11-11 25/week @ 2024-11-18 29/week @ 2024-11-25 211/week @ 2024-12-02 51/week @ 2024-12-09 32/week @ 2024-12-16 24/week @ 2024-12-23 16/week @ 2024-12-30 50/week @ 2025-01-06

123 downloads per month

MIT license

56KB
598 lines

Official and maintained remi-rs crate for support of Microsoft's Azure Blob Storage

v0.10.0 | ๐Ÿ“œ Documentation
Crate Features Description Enabled by default?
export-azure Exports all the used Azure crates as a module called core Yes.
unstable Tap into unstable features from remi_azure and the remi crate. No.
tracing Enables the use of tracing::instrument and emit events for actions by the crate. No.
serde Enables the use of serde in StorageConfig No.
log Emits log records for actions by the crate No.

Example

// Cargo.toml:
//
// [dependencies]
// remi = "^0"
// remi-azure = "^0"
// tokio = { version = "^1", features = ["full"] }

use remi_azure::{StorageService, StorageConfig, Credential, CloudLocation};
use remi::{StorageService as _, UploadRequest};

#[tokio::main]
async fn main() {
    let storage = StorageService::new(StorageConfig {
        credentials: Credential::Anonymous,
        container: "my-container".into(),
        location: CloudLocation::Public("my-account".into()),
    }).unwrap();

    // Initialize the container. This will:
    //
    // * create `my-container` if it doesn't exist
    storage.init().await.unwrap();

    // Now we can upload files to Azure.

    // We define a `UploadRequest`, which will set the content type to `text/plain` and set the
    // contents of `weow.txt` to `weow fluff`.
    let upload = UploadRequest::default()
        .with_content_type(Some("text/plain"))
        .with_data("weow fluff");

    // Let's upload it!
    storage.upload("weow.txt", upload).await.unwrap();

    // Let's check if it exists! This `assert!` will panic if it failed
    // to upload.
    assert!(storage.exists("weow.txt").await.unwrap());
}

Dependencies

~18MB
~292K SLoC