S3: Add global_prefix and prefix_folders options #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds 2 configuration options to simpleblob, to offer extra control over handling prefixes within a bucket:
global_prefix
is a prefix applied to all operations, allowing work within a prefix seamlessly (Default: "" - matches current v0.2.1 behaviour)prefix_folders
can be enabled to prevent List operations from including all items in subfolders (Default: false - differs from v0.2.1 behaviour, but this is not expected to affect anyone)Tests have been updated to cover both options.
Examples - Recursive
(Some items below refer to Recursive, which is the same as !PrefixFolders. We renamed it)
If a bucket contains the following:
Then a List() using
Recursive
unset orfalse
will yield (this is the current v0.2.1 behaviour):If
Recursive
is set totrue
, then a List() will yield:Examples - GlobalPrefix
If a bucket contains the following:
Then a List() using
GlobalPrefix
unset or""
will yield (this is the current v0.2.1 behaviour):If
GlobalPrefix
is set to"foo/"
, then a List() will yield:And a Store() action for name
bar5
, followed by List() will yield:The actual contents of the bucket will now be:
Examples - GlobalPrefix & Recursive
global_prefix = "foo/"
andrecursive = true
will result in a List() returning:global_prefix = ""
andrecursive = true
will result in a List() returning: