xftp

package
v0.0.0-...-491aced Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	File = iota
	Folder
	Unknown
)

-

Variables

This section is empty.

Functions

This section is empty.

Types

type IFtp

type IFtp interface {
	//Close()
	FileSize(path string) (int64, error)
	Exists(path string) error
	Delete(path string) error
	Rename(from, to string) error
	StorFrom(path string, r io.Reader, offset uint64) error
	RetrFrom(path string, w io.Writer, offset uint64) error
	ChangeDir(dir string) error
	ChangeDirToParent() error
	CurrentDir() (string, error)
	List(path string) ([]TEntry, error)
	Quit() error
}

IFtp -

func New

func New(conn string) (IFtp, error)

New - conn: proto://user:pswd@host/path:port proto - currently ftp or sftp only all fields are necessary

type TConnStruct

type TConnStruct struct {
	Proto, Username, Password, Host, Path, Port string
}

TConnStruct -

func ParseConnString

func ParseConnString(conn string) (*TConnStruct, error)

ParseConnString -

type TEntry

type TEntry struct {
	Name string
	Size int64
	Time time.Time
	Type int
}

TEntry -

type TFtp

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

TFtp -

func (*TFtp) ChangeDir

func (o *TFtp) ChangeDir(dir string) error

ChangeDir -

func (*TFtp) ChangeDirToParent

func (o *TFtp) ChangeDirToParent() error

ChangeDirToParent -

func (*TFtp) CurrentDir

func (o *TFtp) CurrentDir() (string, error)

CurrentDir -

func (*TFtp) Delete

func (o *TFtp) Delete(path string) error

Delete -

func (*TFtp) Exists

func (o *TFtp) Exists(path string) error

Exists -

func (*TFtp) FileSize

func (o *TFtp) FileSize(path string) (int64, error)

FileSize -

func (*TFtp) List

func (o *TFtp) List(path string) ([]TEntry, error)

List -

func (*TFtp) Quit

func (o *TFtp) Quit() error

Quit -

func (*TFtp) Rename

func (o *TFtp) Rename(from, to string) error

Rename -

func (*TFtp) RetrFrom

func (o *TFtp) RetrFrom(path string, w io.Writer, offset uint64) error

RetrFrom issues a RETR FTP command to fetch the specified file from the remote FTP server, the server will not send the offset first bytes of the file.

func (*TFtp) StorFrom

func (o *TFtp) StorFrom(path string, r io.Reader, offset uint64) error

StorFrom -

type TSftp

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

TSftp -

func (*TSftp) ChangeDir

func (o *TSftp) ChangeDir(dir string) error

ChangeDir -

func (*TSftp) ChangeDirToParent

func (o *TSftp) ChangeDirToParent() error

ChangeDirToParent -

func (*TSftp) CurrentDir

func (o *TSftp) CurrentDir() (string, error)

CurrentDir -

func (*TSftp) Delete

func (o *TSftp) Delete(path string) error

Delete -

func (*TSftp) Exists

func (o *TSftp) Exists(path string) error

Exists -

func (*TSftp) FileSize

func (o *TSftp) FileSize(path string) (int64, error)

FileSize -

func (*TSftp) List

func (o *TSftp) List(path string) ([]TEntry, error)

List -

func (*TSftp) Quit

func (o *TSftp) Quit() error

Quit -

func (*TSftp) Rename

func (o *TSftp) Rename(from, to string) error

Rename -

func (*TSftp) RetrFrom

func (o *TSftp) RetrFrom(path string, w io.Writer, offset uint64) error

RetrFrom issues a RETR FTP command to fetch the specified file from the remote FTP server, the server will not send the offset first bytes of the file.

func (*TSftp) StorFrom

func (o *TSftp) StorFrom(path string, r io.Reader, offset uint64) error

StorFrom -

Jump to

Keyboard shortcuts

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