Implements multi-file upload and download #70
Merged
+129
−40
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.
This PR affects the following two issues tracked relating to multi-file upload/download in an ssh session. I implemented a similar approach to qcha0 (you'll have to take it on faith that this is my own independent work, but I was obviously influenced by some of their design decisions). However, since they don't seem to have been active for some time, I decided to go ahead and submit a PR for this. I have been using your go library (thank you by the way for implementing this great tool!) in one of my projects, and it would be very nice to have this feature as it simplifies my project's implementation significantly. The change mainly consists of just creating a new session with the ssh client each time you upload/download a file rather than keeping around the ssh session for the lifetime of the struct.
I added a test that uploads two files and downloads them subsequently to your tests folder, but I can add a couple more depending on what other edge cases I should cover.
This PR should close both issues #59 and #60 in your issue tracking.
Let me know if you need me to change anything or add anymore test coverage.
Thanks!