crates.io  TinyGo Version

wasmCloud Blobstore Interface

The blobstore interface abstracts a service (capability provider) that can manage containers and objects. Actors that use this interface must have the capability contract wasmcloud:blobstore in their claims list (wash claims sign --blob_store).

Capability Provider Implementations

The following is a list of implementations of the wasmcloud:blobstore contract. Feel free to submit a PR adding your implementation if you have a community/open source version.

| Name | Vendor | Description | | :--- | :---: | :--- | | blobstore-s3 | wasmCloud | An AWS S3 implementation of a blobstore that manages S3 buckets and objects | ⚠️ WIP: blobstore-fs | wasmCloud | An implementation that manages folders and files on a filesystem

Example Usage (🦀 Rust)

Create a container in a blobstore: ```rust use std::result::Result; use wasmbusrpc::actor::prelude::*; use wasmcloudinterfaceblobstore::{Blobstore, BlobstoreSender}; async fn createcontainer(ctx: &Context, containername: &str) -> Result<(), RpcError> { let blobstore = BlobstoreSender::new(); blobstore .createcontainer(ctx, &containername.tostring()) .await }

Uploading an object (image bytes) to a blobstore: rust use std::result::Result; use wasmbusrpc::actor::prelude::*; use wasmcloudinterfaceblobstore::{ Blobstore, BlobstoreSender, Chunk, PutObjectRequest, PutObjectResponse, }; async fn uploadbytes(ctx: &Context, imagebytes: &[u8]) -> Result { BlobstoreSender::new() .putobject( ctx, &PutObjectRequest { chunk: Chunk { containerid: "myfolder".tostring(), objectid: "myobjectname".tostring(), bytes: imagebytes.tovec(), offset: 0, islast: true, }, contenttype: Some("image/png".to_string()), ..Default::default() }, ) .await } ```