ftp

package
v0.0.0-...-8411d4f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Config Config
	Client *goftp.Client
	// contains filtered or unexported fields
}

func New

func New(config Config) (*Client, error)

func (Client) AssetFS

func (this Client) AssetFS() (assetfs.Interface, error)

func (Client) Delete

func (client Client) Delete(path string) error

Delete delete file

func (Client) Get

func (client Client) Get(path string) (file *os.File, err error)

Get receive file with given path

func (Client) GetDynamicURL

func (client Client) GetDynamicURL(scheme, host string, p ...string) (url string)

func (Client) GetEndpoint

func (client Client) GetEndpoint() *oss.Endpoint

GetEndpoint get endpoint, FileSystem's endpoint is /

func (Client) GetURL

func (client Client) GetURL(p ...string) (url string)

func (Client) List

func (client Client) List(path string) ([]*oss.Object, error)

List list all objects under current path

func (Client) MkdirAll

func (client Client) MkdirAll(path string) error

Put store a reader into given path

func (Client) Path

func (client Client) Path(path string) string

Get receive file with given path

func (Client) Put

func (client Client) Put(path string, reader io.Reader) (*oss.Object, error)

Put store a reader into given path

func (Client) ServeHTTP

func (client Client) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (Client) Stat

func (client Client) Stat(path string) (info os.FileInfo, notFound bool, err error)

Delete delete file

type Config

type Config struct {
	Hosts              []string
	RootDir            string
	User               string
	Password           string
	Endpoint           oss.Endpoint
	ConnectionsPerHost int
	// value in seconds
	Timeout int64
}

Jump to

Keyboard shortcuts

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