-
Notifications
You must be signed in to change notification settings - Fork 91
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
Implement CopyFromRemote for io.Reader filesink #12
Conversation
return errors.New("no scp cmd found") | ||
} | ||
|
||
func pipes(s *ssh.Session) (io.Reader, io.Reader, io.WriteCloser, error) { |
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.
pipes
probably doesn't need to return stderr
, but maybe it would be useful?
2cdceae
to
8f1c139
Compare
This looks very interesting. |
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.
About command.go:
I very much like the idea to represent the command itself as a struct.
However I am unsure about the format of the permissions.
I think they should be in octal base right?
Futhermore, converting the integers to a string is a bit redundant as the Sprintf function would happily take integers by using "%d", the same applies to octal representation by using "%o", however it is possible that you will need to zero pad that one on the left, so that 0777 is really converted to 0777.
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.
About the other file:
This is quite a lot of code.
I will take a look at it later this week.
Ah yeah -- good catch! I didn't use the |
client.go
Outdated
|
||
var i int | ||
for { | ||
i = i + 1 |
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.
This was debug code that can be removed now, along with the var i int
… error) Add a CopyFromRemote which returns an io.Reader with the contents of the remote file
0a77f33
to
05d2de4
Compare
Hello! I've cleaned up the code to deal with permissions to use |
- Change size to uint64
05d2de4
to
525c0b1
Compare
b6becfb
to
dcca06c
Compare
dcca06c
to
cda28e9
Compare
I am sorry for the late response. I will take a look at it next week. |
any chance this will get merged soon? |
Yes, @clarkezone, I will try to make time to look at the changes this week. |
@bramvdbogaerde @clarkezone is this something you plan to merge sometime soon? |
Indeed, it has been a while since this pull request was first created. I think the idea is great, I do like the implementation but I have some small issues with some parts of the code, currently I don't have much time to carefully review the code and make some changes where necessary. I will try to do that by the end of the month. |
Any updates on this? |
@bramvdbogaerde If you don't have time to maintain the project maybe you could add a new maintainer. If you don't know anyone interested in becoming the new maintainer, you can create an issue and ask who is interested. See this issue |
I am sorry for my late response @DrunkenPoney, this project is certainly not dead, as can be demonstrated by my recent commits. I plan to work on it more frequently now, and hope to have the suggested features added soon. |
when is this change going to be merged ? This is a handy functionality which is needed. |
Hello Any plans to get this merged? |
Is this PR dead? |
I am sorry to keep you all waiting for so long. I will try to review this pull request somewhere in the next few weeks and make |
Hello, I'm playing around with this improvement because I need to write a lambda with is reading from a remote file. Thanks a lot. |
At last, this was merged in PR #30, that PR has taken some inspiration from this PR, so many thanks for the changes here too. |
This PR introduces CopyFromRemote (from #1) which returns an
io.Reader
with the file contents, the remote file permissions (as an int) and an error if it occurred.Closes #1