ds_storage_gcp 0.0.1 copy "ds_storage_gcp: ^0.0.1" to clipboard
ds_storage_gcp: ^0.0.1 copied to clipboard

Google Cloud Storage provider for DartStream.

DartStream GCS Storage Provider #

Google Cloud Storage provider for DartStream using the official googleapis client.

Install #

dependencies:
  ds_storage_base: ^0.0.1
  ds_storage_gcp: ^0.0.1

Usage #

import 'package:ds_storage_base/ds_storage_base_export.dart';
import 'package:ds_storage_gcp/ds_storage_gcp_export.dart';

final config = {
  'name': 'gcs',
  'bucket': 'my-gcs-bucket',
  'serviceAccountPath': '/path/to/service-account.json',
};

registerGcpStorageProvider(config);

final storage = DSStorageManager('gcs');
await storage.initialize(config);

await storage.uploadFile('avatars/user.png', bytes);
final signed = await storage.getSignedUrl('avatars/user.png');

Configuration #

  • bucket (optional if you pass bucket/object paths)
  • serviceAccountPath or serviceAccount (required)
  • scopes (optional)
  • publicUrl / baseUrl (optional)
  • name (optional, default gcs)

Notes #

  • Signed URLs use an OAuth access token and expire with the token lifetime.
  • If no default bucket is configured, pass bucket/object as the path.
0
likes
120
points
28
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Google Cloud Storage provider for DartStream.

License

unknown (license)

Dependencies

_discoveryapis_commons, ds_storage_base, googleapis, googleapis_auth

More

Packages that depend on ds_storage_gcp