ftp

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exist

func Exist(ftpClient *ftp.ServerConn, sPath string) (bool, error)

Exist 判断远程文件是否存在

func Mkdir

func Mkdir(ftpClient *ftp.ServerConn, sPath string) error

func SetPath

func SetPath(ftpClient *ftp.ServerConn, sPath string) (string, error)

SetPath 设置当前 文件全路径

Types

type Config

type Config struct {
	Host string `json:"host" yaml:"host" ini:"host"` // ftp地址:端口
	User string `json:"user" yaml:"user" ini:"user"`
	Pwd  string `json:"pwd" yaml:"pwd" ini:"pwd"` // 密码
	// 这部分是ftp的
	Epsv int `ini:"epsv" yaml:"epsv" json:"epsv,omitempty" gorm:"type:int;not null;default:0;comment:连接模式"` // ftp 连接模式,0 被动模式 1 主动模式
	// contains filtered or unexported fields
}

Config ftp 配置

func (*Config) Close

func (this *Config) Close()

func (*Config) Delete

func (this *Config) Delete(p string) error

func (*Config) DeleteAll

func (this *Config) DeleteAll(p string) error

func (Config) GormDBDataType

func (Config) GormDBDataType(db *gorm.DB, field *schema.Field) string

func (Config) GormDataType

func (this Config) GormDataType() string

func (*Config) ListFiles

func (this *Config) ListFiles(dirPath string) ([]string, error)

func (*Config) Login

func (this *Config) Login() error

Login ftp登录

func (*Config) Read

func (this *Config) Read(p string) (io.ReadCloser, error)

func (*Config) RemovePasswd

func (this *Config) RemovePasswd()

func (*Config) Scan

func (this *Config) Scan(val interface{}) error

func (*Config) SetInfo

func (this *Config) SetInfo(args ...any)

func (*Config) Valid

func (this *Config) Valid() error

func (Config) Value

func (this Config) Value() (driver.Value, error)

func (*Config) Write

func (this *Config) Write(p string, src io.Reader, existIgnores ...bool) (int64, error)

Write 写入文件

Jump to

Keyboard shortcuts

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