-
Notifications
You must be signed in to change notification settings - Fork 61
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
'File' is not a member type of 'S3' #18
Comments
I strongly suggest to rename Right now it collides with Vapor directly, and it can collide with so many more libraries... |
Renaming File to S3File sounds like the best option to me. |
I believe renaming the S3 class so it doesn't bear the name of the package. It is a bad practise (which I wasn't aware of at the time of making the library) for the reasons of being unable to namespace. Regarding the struct names, I strongly support the most obvious names even if a possible conflict with a sister package is available. I will be back in the coding den next week and will make the change unless someone would like to help and make a PR beforehand? |
So what will the new name for the S3 File class be? |
File ... but you will be able to do S3.File to namespace as S3 won't be the name of the client but the package |
Perfect. |
What name would you like it to have? |
Just |
We will have again conflict with Vapor then :/ |
We won't as we'll be able to namespace |
Client, File, Object ... all of that should be possible in any package ... you don't have to name your objects with prefixes just to make sure someone's else lib won't conflict with your naming conventions like we did in ObjC |
I do understand and agree most of the times. They are not package prefixes. For me they are specialozation in this case. You are clearly static that it is S3 client or file. But, I agree with you as this is S3 package only. |
Any News? |
When hit with the
|
Using type 'File.Response' generates error 'File' is ambiguous for type lookup in this context. Qualifying it with S3, 'S3.File.Response', generates error 'File' is not a member type of 'S3'.
For example, the response returned in the closure in the code below returns the following error:
expression produced error: error: /var/folders/_p/_xk10nks06103l9_0lsly4c40000gn/T/expr1-8c0981..swift:1:68: error: 'File' is not a member type of 'S3'
Swift._DebuggerSupport.stringForPrintObject(Swift.UnsafePointer<S3.File.Response>(bitPattern: 0x1064fc200)!.pointee)
public func save(file data: Data, to path: String, mime: MediaType, on container: Container) throws -> EventLoopFuture<Void> { let file = File.Upload.init(data: data, destination: path, access: .publicRead, mime: mime.description) return try s3.put(file: file, on: container).map(to: Void.self) { response in return Void() }.catchMap({ error in throw Error.failedWriting(path, error) }) }
It seems like 'put(file:, on:)' is not returning the expected type of Future<File.Response>.
The text was updated successfully, but these errors were encountered: