Documentation ¶
Overview ¶
Package ftp implement ftp protocol for file transfer
Index ¶
- Variables
- type Auth
- type Driver
- func (d *Driver) ChangeDir(path string) (err error)
- func (d *Driver) DeleteDir(path string) (err error)
- func (d *Driver) DeleteFile(path string) (err error)
- func (d *Driver) GetFile(path string, offset int64) (size int64, rc io.ReadCloser, err error)
- func (d *Driver) Init(conn *server.Conn)
- func (d *Driver) ListDir(path string, callback func(server.FileInfo) error) (err error)
- func (d *Driver) MakeDir(path string) (err error)
- func (d *Driver) PutFile(path string, dataConn io.Reader, append bool) (bytes int64, err error)
- func (d *Driver) Rename(fromPath string, toPath string) (err error)
- func (d *Driver) Stat(path string) (fileInfo server.FileInfo, err error)
- type Factory
- type FileInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrTokenPassword represent the password of token is wrong ErrTokenPassword = errors.New("toke password validate failed") // ErrAppPassword represent the password of app is wrong ErrAppPassword = errors.New("app password validate failed") // ErrTokenNotFound represent that wrong token is being used ErrTokenNotFound = errors.New("token not found") )
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is used to operate files
func (*Driver) ChangeDir ¶
ChangeDir is used to toggle current directory, if the directory doesn't exist, it will be created.
func (*Driver) DeleteFile ¶
DeleteFile is used to delete file by the path
type Factory ¶
type Factory struct{}
Factory is a driver factory, is used to generate driver when new connection comes
type FileInfo ¶
type FileInfo struct {
// contains filtered or unexported fields
}
FileInfo is used to represent the information of file or directory
Click to show internal directories.
Click to hide internal directories.