aws 1.1.0

aws client services


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

AWS Client

Client for AWS services. Currently only supports S3.

Usage

import aws.s3;
import aws.aws;
import aws.credentials;
import std.algorithm : joiner;
import std.array : array;

void main() {
    import std.array : appender;
    import std.stdio;
    auto creds = new StaticAWSCredentials("test", "test");

    auto region = "us-east-1";
    auto endpoint = "http://localhost:4566";
    auto s3 = new S3(endpoint,region,creds);

    s3.createBucket("test-bucket");
    s3.upload("test-bucket", "myfile", cast(ubyte[])[48,49,50,51,52,53]);
    s3.download("test-bucket", "myfile").receiveAsRange.joiner().array().writeln();
    auto directories = appender!string;
    auto files = appender!string;

    string marker = null;
    while(true)
        {
            auto result = s3.list("test-bucket", "/", null,marker,100);
            foreach(directory; result.commonPrefixes)
                directories.put(directory~"\n");

            foreach(file; result.resources)
                files.put(file.key~"\n");

            if (result.isTruncated)
                marker = result.nextMarker;
            else
                break;
        }


    writeln(directories);
    writeln(files);
}
Authors:
  • Rico Huijbers
  • Yannick Koechlin
  • Manuel Frischknecht
  • Ilya Yaroshenko
  • Sebastiaan Koppe
Dependencies:
requests, arsd-official:dom
Versions:
1.1.0 2021-Jul-20
1.0.0 2021-Jul-15
~master 2021-Jul-27
Show all 3 versions
Download Stats:
  • 0 downloads today

  • 1 downloads this week

  • 5 downloads this month

  • 5 downloads total

Score:
0.6
Short URL:
aws.dub.pm