Crate http_to_s3
source ·Expand description
A small library that tries to efficiently copy files from HTTP endpoints to a S3 compatible endpoint. Uses tokio / reqwest and the official s3 sdk.
Examples
Simple example that uploads a file from http to s3.
Requires the following env-vars to be set:
S3_ENDPOINT_HOST
= The S3 endpoint that should be used
AWS_ACCESS_KEY_ID
= S3 Access Key
AWS_SECRET_ACCESS_KEY
= S3 Secret Key
use http-to-s3::upload_file;
upload_file(
"https://speed.hetzner.de/100MB.bin".to_string(),
"test_bucket".to_string(), // Will be created if not exists
"test_key".to_string(), // The key in the s3 repo
None
)
.await
.unwrap();
Ok(())
Constants
Functions
Main function for this crate