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

This section is empty.

Types

type Config

type Config struct {
	Host string `json:"host" yaml:"host" ini:"host"`
	User string `json:"user" yaml:"user" ini:"user"`
	Pwd  string `json:"pwd" yaml:"pwd" ini:"pwd"`
	Epsv Epsv   `ini:"epsv" yaml:"epsv" json:"epsv,omitempty"` // ftp连接模式
}

Config ftp 配置 noinspection all

func (Config) GormDBDataType

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

noinspection all

func (Config) GormDataType

func (c Config) GormDataType() string

noinspection all

func (*Config) RemovePasswd

func (c *Config) RemovePasswd()

noinspection all

func (*Config) Scan

func (c *Config) Scan(val any) error

noinspection all

func (*Config) SetInfo

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

noinspection all

func (*Config) Valid

func (c *Config) Valid() error

noinspection all

func (Config) Value

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

noinspection all

type Epsv

type Epsv int

Epsv ftp连接模式 noinspection all

const (
	EpsvPassive Epsv = 0
	EpsvActive  Epsv = 1
)

0 被动模式 1 主动模式 noinspection all

type Saver

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

func New

func New(cfg *Config) (*Saver, error)

func (*Saver) Close

func (s *Saver) Close() error

func (*Saver) Delete

func (s *Saver) Delete(p string) error

func (*Saver) DeleteAll

func (s *Saver) DeleteAll(p string) error

func (*Saver) ListFiles

func (s *Saver) ListFiles(dirPath string) ([]string, error)

func (*Saver) Read

func (s *Saver) Read(p string) (io.ReadCloser, error)

Read 读取文件

func (*Saver) Write

func (s *Saver) 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