toolcraft-s3-kit
S3-compatible object storage utilities for the toolcraft ecosystem.
Features
- 🚀 S3-compatible object storage client
- 📦 Support for MinIO and other S3-compatible services
- 🔐 Secure credential management
- ⚡ Async/await support with Tokio
- 🧩 Easy integration with the toolcraft ecosystem
Installation
Add this to your Cargo.toml:
[]
= "*"
Check the crates.io page for the latest version.
Quick Start
use S3Client;
async
Core Features
S3 Client
The S3Client provides a high-level interface for interacting with S3-compatible storage:
- Bucket Operations: Create, list, and delete buckets
- Object Operations: Upload, download, list, and delete objects
- Presigned URLs: Generate time-limited URLs for object access
- Streaming: Support for streaming large files
- Error Handling: Comprehensive error types for all operations
Example Usage
use S3Client;
async
Download Examples
use S3Client;
async
Advanced Features
Custom Configuration
use S3Client;
let client = new?;
Error Handling
The crate provides detailed error types for different failure scenarios:
use ;
match client.get_object.await
Supported S3 Operations
-
Bucket Operations
create_bucket()list_buckets()delete_bucket()bucket_exists()
-
Object Operations
put_object()get_object()delete_object()list_objects()object_exists()read_text_file()- Read text files from S3download_file()- Download files to local filesystemdownload_to_bytes()- Download files to memory
-
Presigned URLs
presigned_get_object()presigned_put_object()
Integration with toolcraft
This crate is designed to work seamlessly with other toolcraft components:
// Use with toolcraft-config for configuration management
use Config;
use S3Client;
let config = from_file?;
let s3_endpoint = config.get_string?;
let s3_access_key = config.get_string?;
let s3_secret_key = config.get_string?;
let client = new?;
License
This project is licensed under the MIT License - see the LICENSE file for details.