Versions in this module Expand all Collapse all v0 v0.0.2 Aug 20, 2024 Changes in this version + var DebugMode = false + var DefaultDirPerm = os.FileMode(0755) + var DefaultFilePerm = os.FileMode(0644) + var DirectoryPreReads = 10 + var ErrInvalidWrite = errors.New("invalid write result") + var ErrNoClientOption = errors.New("scp: ClientOption is not provided") + var ErrNoTransferOption = errors.New("scp: TransferOption is not provided") + var MAX_BUFFSIZE int64 = 1024 * 1024 + var MIN_BUFFSIZE int64 = 32 * 1024 + func NewSSHConfigFromPassword(username, password string) *ssh.ClientConfig + func NewSSHConfigFromPrivateKey(username string, privPEM []byte, passphrase ...string) (cfg *ssh.ClientConfig, err error) + type Client struct + func NewClient(serverAddr string, sshCfg *ssh.ClientConfig, scpOpt *ClientOption) (*Client, error) + func NewClientFromExistingSSH(existing *ssh.Client, scpOpt *ClientOption) (*Client, error) + func (c *Client) CopyDirFromRemote(remoteDir, localDir string, opt *DirTransferOption) error + func (c *Client) CopyDirToRemote(localDir string, remoteDir string, opt *DirTransferOption) error + func (c *Client) CopyFileFromRemote(remoteFile, localFile string, opt *FileTransferOption) error + func (c *Client) CopyFileToRemote(localFile string, remoteLoc string, opt *FileTransferOption) error + func (c *Client) CopyFromRemote(remoteFile string, buffer io.Writer, opt *FileTransferOption) error + func (c *Client) CopyToRemote(reader io.Reader, remoteTarget string, opt *FileTransferOption) error + type ClientOption struct + RemoteBinary string + Sudo bool + type DirTransferOption struct + ContentOnly bool + Context context.Context + ObserverCallback func(ObserveEventType, TransferInfo) + PreserveProp bool + SpeedLimit int64 + Timeout time.Duration + type FileTransferOption struct + Context context.Context + ObserverCallback func(ObserveEventType, TransferInfo) + Perm os.FileMode + PreserveProp bool + SpeedLimit int64 + Timeout time.Duration + type KnownSize interface + Size func() int64 + type ObserveEventType string + const ObserveEventEnd + const ObserveEventStart + const ObserveEventTick + type TransferInfo interface + Err func() error + LastUpdate func() time.Time + Name func() string + Path func() string + TotalSize func() int64 + TransferredSize func() int64