Documentation
¶
Index ¶
- Constants
- type EntryHandler
- type FileSource
- type FtpClient
- func (this *FtpClient) Download(local, remote, file string) error
- func (this *FtpClient) Finish() error
- func (this *FtpClient) GetFile(path string) ([]string, error)
- func (this *FtpClient) Handler(e *ftp.Entry, currentPath string) error
- func (this *FtpClient) HandlerUpload(e *ftp.Entry, currentPath string) error
- func (this *FtpClient) Init(protocol, ip, port, user, pass string) error
- func (this *FtpClient) Rename(tmp, dst, file string) error
- func (this *FtpClient) Upload(local, remote, file string) error
- func (this *FtpClient) Walk(rootDir string) error
- type FtpFile
- type Server
Constants ¶
View Source
const (
DataSize = 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EntryHandler ¶
EntryHandler 遍历ftp目录时的文件handler
type FtpClient ¶
type FtpClient struct { Protocol string Ftp *ftp.ServerConn Ssh *ssh.Client Sftp *sftp.Client // contains filtered or unexported fields }
func NewFtpClient ¶
func NewFtpClient() *FtpClient
func (*FtpClient) HandlerUpload ¶
函调函数-上传
type FtpFile ¶
type FtpFile struct { FileName string //FTP文件名 Path string //FTP文件的全路径+文件名 Type int //FTP文件类型,文件:0, 文件夹:1 Size int //FTP文件大小 }
FTP文件信息
type Server ¶
type Server struct { Protocol string `json:"Protocol"` IP string `json:"IP"` Port string `json:"Port"` UserName string `json:"UserName"` PassWord string `json:"PassWord"` RemotePath string `json:"RemotePath"` // 远程临时目录(上传用) TargetPath string `json:"TargetPath"` // 远程目标目录(上传用,下载时为目标目录) RmtTmpPath string `json:"RmtTmpPath"` // 远程临时目录(上传用,向下兼容) BackupPath string `json:"BackupPath"` // 备份目录(上传后将本地文件转移到的目标目录,下载后将远程文件转移到的目标目录) LocalPath string `json:"LocalPath"` // 本地目标目录(下载为目标目录,上传为源目录) TempPath string `json:"TempPath"` // 本地临时目录(下载为临时目录,上传不用) }
Click to show internal directories.
Click to hide internal directories.