ftp

package
v2.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client 客户端连接

func (*Client) ChangeDir

func (client *Client) ChangeDir(path string) error

ChangeDir 将当前目录更改为指定的路径

func (*Client) ChangeDirToParent

func (client *Client) ChangeDirToParent() error

ChangeDirToParent 将当前目录更改为父目录。这类似于对ChangeDir的调用,路径设置为“..”

func (*Client) CurrentDir

func (client *Client) CurrentDir() (string, error)

CurrentDir 返回当前目录的路径

func (*Client) Delete

func (client *Client) Delete(path string) error

Delete 从远程FTP服务器删除指定的文件

func (*Client) DownFile

func (client *Client) DownFile(serverPath, destPath string) error

DownFile 下载文件到本地

func (*Client) FileSize

func (client *Client) FileSize(path string) (int64, error)

FileSize 返回文件的大小

func (*Client) List

func (client *Client) List(path string) (filesData []FileData, err error)

List 返回文件夹下所有文件

func (*Client) Login

func (client *Client) Login() error

Login 验证登录

func (*Client) Logout

func (client *Client) Logout() error

Logout ..

func (*Client) MakeDir

func (client *Client) MakeDir(path string) error

MakeDir ..

func (*Client) NameList

func (client *Client) NameList(path string) ([]string, error)

NameList 返回文件夹下所有文件

func (*Client) Quit

func (client *Client) Quit() error

Quit ..

func (*Client) RemoveDir

func (client *Client) RemoveDir(path string) error

RemoveDir ..

func (*Client) RemoveDirRecur

func (client *Client) RemoveDirRecur(path string) error

RemoveDirRecur ..

func (*Client) Rename

func (client *Client) Rename(from, to string) error

Rename ..

func (*Client) UploadFile

func (client *Client) UploadFile(srcFullPath, serverPath string) error

UploadFile 上传本地文件到服务器

type Config

type Config struct {
	Host     string
	Port     string
	User     string
	Password string
	Timeout  time.Duration
}

Config 配置

func (*Config) New

func (config *Config) New() *Client

New 新建连接

type FileData

type FileData struct {
	Name string
	Size uint64
	Type string
}

FileData 文件

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL