Versions in this module Expand all Collapse all v1 v1.1.5 Oct 8, 2023 v1.1.4 Jul 27, 2023 v1.1.3 Jul 27, 2023 Changes in this version + type FileHandler func(path string, mode os.FileMode, reader io.Reader) error type SCP + func (s *SCP) DownloadWithHandler(remote string, local string, handler FileHandler) error v1.1.2 May 10, 2022 v1.1.1 May 10, 2022 v1.1.0 May 10, 2022 Changes in this version + type Option func(s *SCP) + func WithRemoteSShBinaryPath(path string) Option + func WithSFTP(enable bool) Option + type Session interface + Close func() + Recv func(remote string, local string) error + Send func(local string, remote string) error + func NewSFTPSession(sshCli *ssh.Client) (Session, error) + func NewScpSession(sshCli *ssh.Client, remoteScpBinary string) (Session, error) v1.0.0 Nov 8, 2020 Changes in this version + type Msg string + func (m Msg) FileInfo() (mode os.FileMode, size int64, filename string, err error) + func (m Msg) String() string + type Resp struct + Msg Msg + Type RespType + func NewDirBegin(mode os.FileMode, dirname string) *Resp + func NewDirEnd() *Resp + func NewErrorRsp(msg string) *Resp + func NewFile(mode os.FileMode, filename string, size int64) *Resp + func NewOkRsp() *Resp + func NewWarnRsp(msg string) *Resp + func ReadResp(reader io.Reader) (*Resp, error) + func (rsp *Resp) GetMessage() Msg + func (rsp *Resp) IsDir() bool + func (rsp *Resp) IsEndDir() bool + func (rsp *Resp) IsError() bool + func (rsp *Resp) IsFailure() bool + func (rsp *Resp) IsFile() bool + func (rsp *Resp) IsOk() bool + func (rsp *Resp) IsWarning() bool + func (rsp *Resp) Write(w io.Writer) error + func (rsp *Resp) WriteStream(w io.Writer, stream io.Reader) error + type RespType = uint8 + const Error + const Ok + const StreamC + const StreamD + const StreamE + const Warning + type SCP struct + RemoteBinary string + func New(addr string, cfg *ssh.ClientConfig) (*SCP, error) + func (s *SCP) Close() error + func (s *SCP) Download(remote string, local string) error + func (s *SCP) Upload(local string, remote string) error