dospace 0.9.5

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new65

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;

main() async {
  dospace.Spaces spaces = new dospace.Spaces(
    region: "nyc3",
    accessKey: "7Q7GAFJ4IXHQVLBRXSRX",
    secretKey: "2JLXa9RqPwpavBkC7dt1MHWUDfd6onaXTXTfSYc5eQ0",
  );
  for (String name in await spaces.listAllBuckets()) {
    print('bucket: ${name}');
    dospace.Bucket bucket = spaces.bucket(name);
    await for (dospace.BucketContent content in bucket.listContents(maxKeys: 3)) {
       print('key: ${content.key}');
    }
  }
  String etag = await spaces.bucket('example').uploadFile(
    'README.md', 'README.md', 'text/plain', dospace.Permissions.Public);
  print('upload: $etag');
  print('done');
}

References

0.9.4

  • Adjust version dependency

0.9.4

  • Implement file upload

0.9.3

  • Simplify library usage

0.9.2

  • Initial version

example/dospace_example.dart

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

main() async {
  dospace.Spaces spaces = new dospace.Spaces(
    region: "nyc3",
    accessKey: "7Q7GAFJ4IXHQVLBRXSRX",
    secretKey: "2JLXa9RqPwpavBkC7dt1MHWUDfd6onaXTXTfSYc5eQ0",
  );
  for (String name in await spaces.listAllBuckets()) {
    print('bucket: ${name}');
    dospace.Bucket bucket = spaces.bucket(name);
    await for (dospace.BucketContent content
        in bucket.listContents(maxKeys: 3)) {
      print('key: ${content.key}');
    }
  }
  String etag = await spaces.bucket('example').uploadFile(
      'README.md', 'README.md', 'text/plain', dospace.Permissions.Public);
  print('upload: $etag');
  print('done');
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dospace: ^0.9.5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dospace/dospace.dart';
  
Version Uploaded Documentation Archive
0.9.5 Aug 8, 2018 Go to the documentation of dospace 0.9.5 Download dospace 0.9.5 archive
0.9.4 Aug 7, 2018 Go to the documentation of dospace 0.9.4 Download dospace 0.9.4 archive
0.9.3 Jul 25, 2018 Go to the documentation of dospace 0.9.3 Download dospace 0.9.3 archive
0.9.2 Jul 24, 2018 Go to the documentation of dospace 0.9.2 Download dospace 0.9.2 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
37
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
65
Learn more about scoring.

We analyzed this package on Aug 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.0.
 
 Because dospace depends on http_client ^0.4.1 which requires SDK version >=1.20.0 <2.0.0, version solving failed.

Fix platform conflicts.

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Package is pre-v1 release.

While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction of the API.

Format lib/src/dospace_exception.dart.

Run dartfmt to format lib/src/dospace_exception.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.58.0 <3.0.0