Adding an scp package is a nice addition.
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.
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.
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.