Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearly differentiate functions that accept prefix vs. key #301

Open
omus opened this issue Jun 29, 2023 · 1 comment
Open

Clearly differentiate functions that accept prefix vs. key #301

omus opened this issue Jun 29, 2023 · 1 comment

Comments

@omus
Copy link
Member

omus commented Jun 29, 2023

I thought about using s3_purge_versions initially, but that purges versions of everything under the prefix, rather than just a specific path---and I very intentionally just want to be touching the specific path here.

Oh my b, I assumed you could provide a full path as the prefix to s3_purge_versions.

We should make an issue to make it clear on a convention for what functions deal with keys and which deal with prefixes. Right now it isn't clear and accidental usage of a prefix function when you though a key was used could be quite dangerous.

Originally posted by @omus in #299 (comment)

We should review the AWS S3 API before making a decision on what we want to do but my initial instinct is that we should have a _prefix suffix on functions that accept prefixes and not for functions that use keys. We could also make use of dispatch with additional types.

@omus
Copy link
Member Author

omus commented Jun 30, 2023

One option I like is using the _object suffix for actions on a single single S3 key/object and _prefix suffix for path prefixes.

For a moment I thought _objects could work for path prefixes but as that's a typo away from disaster I would recommend against it (e.g. s3_delete_objects(bucket, key))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant