-
Notifications
You must be signed in to change notification settings - Fork 3
Add opts to upload
#36
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
base: master
Are you sure you want to change the base?
Conversation
0a95cc6 to
acc84ef
Compare
| end | ||
|
|
||
| def upload(store, source, key) do | ||
| def upload(store, source, key, opts) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add this as a required positional argument, wouldn't that be a breaking change? Should we preserve upload/3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't be. The default opt \\ [] will fill that in.
|
|
||
| def upload(store, source, key) do | ||
| FileStore.upload(store.__next__, source, put_prefix(key, store)) | ||
| def upload(store, source, key, opts) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thought here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will break some what, but a compiler error on the down stream consumer will be returned. They will be notified that they need to fill the rest of it in.
|
Side note, I don't use these middleware things. I don't know if anyone actually does and if it is even that important to have support for them. |
I've found the need to pass along the content type and disposition to Amazon in order to have the correct metadata set on the object. I did not want to load the entire binary into memory to call `write`. Instead, I would like to stream the file from disk.
acc84ef to
0bb4cda
Compare
I've found the need to pass along the content type and disposition to Amazon in order to have the correct metadata set on the object. I did not want to load the entire binary into memory to call
write. Instead, I would like to stream the file from disk.This also expands the typespecs defined. I've opted for
String.t()in places where I feel the developer should know that it is intended to be a human readable value. Even though under the hoodbinary()andString.t()are the same thing, it's still a good signal to the reader.I realize this will conflict with #34, but I am going to rework that one a bit.