DigitalOcean Spaces Storage - robinrodricks/FluentStorage GitHub Wiki
In order to use DigitalOcean Spaces storage you need to reference the FluentStorage.AWS package first. The provider wraps around the standard AWS SDK.
You can use the DigitalOceanSpacesStorage factory class 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".
IStore store = DigitalOceanSpacesStorage.FromCredentials(
accessKeyId, secretAccessKey, bucketName, digitalOceanRegion);To create with a connection string, first reference the module:
AwsS3Storage.Use();Then construct using the following format:
IStore store = StorageFactory.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.
Use our simple polycloud API to perform file and object manipulation operations.
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.
Call the IStore.GetClient() method to return the native SDK client and perform any native operations.