Thanks for your feedback!
2016-09-20 0:02 GMT+09:00 Paul Borman <bor...@google.com>:
> Adding an scp package is a nice addition.
Should I send a pull request to https://github.com/golang/crypto?
If yes, what package? golang.org/x/crypto/scp or golang.org/x/crypto/ssh/scp?
> You might want to consider simple names like:
> Send - Sends from byte to file on remote host
> SendDir - Send files in dir to a remote host
> SendFile - Sends the contents of a file to the remote host
> Fetch - Fetches the contents of a file on remote host into memory
> FetchFile - Fetches a file from remote host into file on local host
> FetchDir - Fetches the files in a directory from the remote host
> These would translate in code to names like scp.SendFile, which is pretty
> descriptive all by itself.
Thanks for simple and descriptive function names.
I renamed functions.
> For the directory copy, it might be better to have a function return the
> io.Writer to write the file to, rather than force the files into a
> directory. This would make it easy to keep the contents in memory, change
> file names, or whatever.
Yes, I agree it might be better not to force the files in a directory.
However I don't think having a function return the io.Writer will do
since we need to read a reply for each scp protocol header or body.
I had read the article below and the openssh source code and
implemented my scp package https://github.com/hnakamur/go-scp.
"How the SCP protocol works (Jan Pechanec's weblog)"
I built two structs sourceProtocol and sinkProtocol
I had thought to export these structs or make interfaces for that.
However the implementation of two functions SendDir and FetchDir
which using these structs become somewhat complex.
So I was not confident about exporting sourceProtocol and sinkProtocol,
and I did not export them at the time.
If we can define structs, functions or interfaces which are easy to use,
I'm glad to export them.
Do you have an idea about such structs, functions or interfaces?
> On Fri, Sep 16, 2016 at 9:41 AM, Hiroaki Nakamura <hnaka...@gmail.com>
>> Hi all,
>> I noticed the golang.org/x/crypto/ssh package exists, but the scp
>> package does not.
>> So I wrote a scp client library in go.
>> I also wrote a sshd server just usable for testing go-scp.
>> Right now, go-scp only exports high level functions which are supposed
>> to be easy to use.
>> However I wonder if there APIs can be improved. For example,
>> better function names and better arguments.
>> Could you tell me what you think?
>> Hiroaki Nakamura
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
For more options, visit https://groups.google.com/d/optout.