Skip to content
forked from dernoun/dospace

Dart client library to interact with the DigitalOcean Spaces API. Same API as Amazon AWS S3.

License

Notifications You must be signed in to change notification settings

jeffaknine/dospace

Repository files navigation

DOSpace

Client library to interact with the DigitalOcean Spaces API.

Usage

A simple usage example:

import 'dart:async';

import 'package:dospace/dospace.dart' as dospace;

Future<List<String>> listAllBuckets() {
  dospace.Client client = new dospace.Client(
    region: "nyc3",
    accessKey: "7Q7GAFJ4IXHQVLBRXSRX",
    secretKey: "2JLXa9RqPwpavBkC7dt1MHWUDfd6onaXTXTfSYc5eQ0",
    endpointUrl: "https://nyc3.digitaloceanspaces.com"
  );
  return client.listAllBuckets();
}

main() async {
  List<String> buckets = await listAllBuckets();
  for (String bucket in buckets) {
    dospace.Client client = new dospace.Client(
      region: "nyc3",
      accessKey: "7Q7GAFJ4IXHQVLBRXSRX",
      secretKey: "2JLXa9RqPwpavBkC7dt1MHWUDfd6onaXTXTfSYc5eQ0",
      endpointUrl: "https://${bucket}.nyc3.digitaloceanspaces.com"
    );
    dospace.ListBucketResult listBucket = await client.listBucketContents();
    print('bucket: ${listBucket.name}');
    print('isTruncated: ${listBucket.isTruncated}');
    for (dospace.ListBucketContents contents in listBucket.contents) {
      print('key: ${contents.key}');
    }
  }
}

References

About

Dart client library to interact with the DigitalOcean Spaces API. Same API as Amazon AWS S3.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%