Giter Site home page Giter Site logo

rusty-s3's Introduction

rusty-s3

crates.io Documentation dependency status Rustc Version 1.52.1+ CI codecov

Simple pure Rust AWS S3 Client following a Sans-IO approach, with a modern and rusty take onto s3's APIs.

Request signing and response parsing capabilities are provided for the most common S3 actions, using AWS Signature Version 4.

Minio compatibility tested on every commit by GitHub Actions.

Examples

use std::env;
use std::time::Duration;
use rusty_s3::{Bucket, Credentials, S3Action};

// setting up a bucket
let endpoint = "https://s3-eu-west-1.amazonaws.com".parse().expect("endpoint is a valid Url");
let path_style = true;
let name = String::from("rusty-s3");
let region = String::from("eu-west-1");
let bucket = Bucket::new(endpoint, path_style, name, region).expect("Url has a valid scheme and host");

// setting up the credentials
let key = env::var("AWS_ACCESS_KEY_ID").expect("AWS_ACCESS_KEY_ID is set and a valid String");
let secret = env::var("AWS_SECRET_ACCESS_KEY").expect("AWS_ACCESS_KEY_ID is set and a valid String");
let credentials = Credentials::new(key, secret);

// signing a request
let presigned_url_duration = Duration::from_secs(60 * 60);
let action = bucket.get_object(Some(&credentials), "duck.jpg");
println!("GET {}", action.sign(presigned_url_duration));

More examples can be found in the examples directory on GitHub.

Supported S3 actions

rusty-s3's People

Contributors

01101101 avatar cykooz avatar dependabot[bot] avatar guerinoni avatar paolobarbolini avatar sktt1ryze avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.