rclone: github.com/ncw/rclone/cmd/serve/ftp Index | Files | Directories

package ftp

import "github.com/ncw/rclone/cmd/serve/ftp"

Index

Package Files

ftp.go

Variables

var Command = &cobra.Command{
    Use:   "ftp remote:path",
    Short: `Serve remote:path over FTP.`,
    Long: "" /* 185 byte string literal not displayed */+
        ftpopt.Help + vfs.Help,
    Run: func(command *cobra.Command, args []string) {
        cmd.CheckArgs(1, 1, command, args)
        f := cmd.NewFsSrc(args)
        cmd.Run(false, false, command, func() error {
            s, err := newServer(f, &ftpflags.Opt)
            if err != nil {
                return err
            }
            return s.serve()
        })
    },
}

Command definition for cobra

type Auth Uses

type Auth struct {
    BasicUser string
    BasicPass string
}

Auth struct to handle ftp auth (temporary simple for POC)

func (*Auth) CheckPasswd Uses

func (a *Auth) CheckPasswd(user, pass string) (bool, error)

CheckPasswd handle auth based on configuration

type Driver Uses

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

Driver implementation of ftp server

func (*Driver) ChangeDir Uses

func (d *Driver) ChangeDir(path string) (err error)

ChangeDir move current folder

func (*Driver) DeleteDir Uses

func (d *Driver) DeleteDir(path string) (err error)

DeleteDir delete a folder and his content

func (*Driver) DeleteFile Uses

func (d *Driver) DeleteFile(path string) (err error)

DeleteFile delete a file

func (*Driver) GetFile Uses

func (d *Driver) GetFile(path string, offset int64) (size int64, fr io.ReadCloser, err error)

GetFile download a file

func (*Driver) Init Uses

func (d *Driver) Init(*ftp.Conn)

Init a connection

func (*Driver) ListDir Uses

func (d *Driver) ListDir(path string, callback func(ftp.FileInfo) error) (err error)

ListDir list content of a folder

func (*Driver) MakeDir Uses

func (d *Driver) MakeDir(path string) (err error)

MakeDir create a folder

func (*Driver) PutFile Uses

func (d *Driver) PutFile(path string, data io.Reader, appendData bool) (n int64, err error)

PutFile upload a file

func (*Driver) Rename Uses

func (d *Driver) Rename(oldName, newName string) (err error)

Rename rename a file or folder

func (*Driver) Stat Uses

func (d *Driver) Stat(path string) (fi ftp.FileInfo, err error)

Stat get information on file or folder

type DriverFactory Uses

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

DriverFactory factory of ftp driver for each session

func (*DriverFactory) NewDriver Uses

func (f *DriverFactory) NewDriver() (ftp.Driver, error)

NewDriver start a new session

type FileInfo Uses

type FileInfo struct {
    os.FileInfo
    // contains filtered or unexported fields
}

FileInfo struct to hold file info for ftp server

func (*FileInfo) Group Uses

func (f *FileInfo) Group() string

Group return group of file. Try to find the group name if possible

func (*FileInfo) Mode Uses

func (f *FileInfo) Mode() os.FileMode

Mode return mode of file.

func (*FileInfo) Owner Uses

func (f *FileInfo) Owner() string

Owner return owner of file. Try to find the username if possible

type Logger Uses

type Logger struct{}

Logger ftp logger output formatted message

func (*Logger) Print Uses

func (l *Logger) Print(sessionID string, message interface{})

Print log simple text message

func (*Logger) PrintCommand Uses

func (l *Logger) PrintCommand(sessionID string, command string, params string)

PrintCommand log formatted command execution

func (*Logger) PrintResponse Uses

func (l *Logger) PrintResponse(sessionID string, code int, message string)

PrintResponse log responses

func (*Logger) Printf Uses

func (l *Logger) Printf(sessionID string, format string, v ...interface{})

Printf log formatted text message

Directories

PathSynopsis
ftpflags
ftpopt

Package ftp imports 18 packages (graph) and is imported by 2 packages. Updated 2019-06-20. Refresh now. Tools for package owners.