xftp

package
v0.0.0-...-2337b38 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 15 Imported by: 2

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
	// ChangeDir(dir string) error
	// CurrentDir() (string, error)
	List(path string) ([]TEntry, error)
	Quit() error
}

IFtp -

func New

func New(cs TConnStruct) (IFtp, error)

New -

func New2

func New2(u *url.URL) (IFtp, error)

New2 -

type TConnStruct

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

TConnStruct -

func ParseConnString

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

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

type TEntry

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

TEntry -

func (TEntry) MarshalJSON

func (o TEntry) MarshalJSON() ([]byte, error)

MarshalJSON -

type TFtp

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

TFtp -

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) 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) 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) 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