-
-
Notifications
You must be signed in to change notification settings - Fork 72
DigitalOcean Spaces Storage
In order to use DigitalOcean Spaces storage you need to reference package first. The provider wraps around the standard AWS SDK which is updated regularly, but adds a lot of untrivial workarounds that makes your life painless.
You can use the DigitalOceanSpaces method to connect to DigitalOcean Spaces storage (S3 compatible).
For digitalOceanRegion, you need to enter the DigitalOcean Region endpoint, like nyc3. This is internally combined into the following string which is used as the Service URL: "https://{digitalOceanRegion}.digitaloceanspaces.com".
IBlobStorage storage = StorageFactory.Blobs.DigitalOceanSpaces(
accessKeyId, secretAccessKey, bucketName, digitalOceanRegion);To create with a connection string, first reference the module:
StorageFactory.Modules.UseAwsStorage();Then construct using the following format:
IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("do.spaces://keyId=...;key=...;bucket=...;region=...;sessionToken=...");where:
- keyId is (optional) access key ID.
- key is (optional) secret access key.
- bucket is bucket name.
- region is the Digital Ocean region code.
- sessionToken is the optional token for temporary AWS credentials.
If you already have credentials in the local credentials file generated by AWS CLI, you can also use them to connect to a bucket with FluentStorage. Look here for more details.
Native operations are exposed via IAwsS3BlobStorageNativeOperations interface.