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>
wrote:

> 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.
> https://github.com/hnakamur/go-scp
>
> I also wrote a sshd server just usable for testing go-scp.
> https://github.com/hnakamur/go-sshd
>
> Right now, go-scp only exports high level functions which are supposed
> to be easy to use.
> https://godoc.org/github.com/hnakamur/go-scp
>
> However I wonder if there APIs can be improved. For example,
> better function names and better arguments.
>
> Could you tell me what you think?
> Thanks!
>
> 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 
"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.

Reply via email to