ftps

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Zlib Imports: 10 Imported by: 3

Documentation

Overview

Package ftps implements a simple FTPS client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client FTPS.

func Dial

func Dial(ctx context.Context, opt DialOptions) (*Client, error)

Dial a FTPS server and return a Client.

func (*Client) Chdir

func (c *Client) Chdir(dir string) error

Chdir changes the current working directory.

func (*Client) Close

func (c *Client) Close() error

Close the FTPS client connection.

func (*Client) Download

func (c *Client) Download(ctx context.Context, name string, w io.Writer) error

Download the file name from the current working directory to the Writer.

func (*Client) Getwd

func (c *Client) Getwd() (dir string, err error)

Getwd gets the current working directory.

func (*Client) List

func (c *Client) List(ctx context.Context) ([]File, error)

List the contents of the current working directory.

func (*Client) Mkdir

func (c *Client) Mkdir(name string) error

Mkdir makes a new directory.

func (*Client) RemoveDir

func (c *Client) RemoveDir(name string) error

RemoveDir removes a directory.

func (*Client) RemoveFile

func (c *Client) RemoveFile(name string) error

RemoveFile removes a file.

func (*Client) Upload

func (c *Client) Upload(ctx context.Context, name string, r io.Reader) error

Upload the contents of Reader to the file name to the current working directory.

type DialOptions

type DialOptions struct {
	Host     string
	Port     int // If zero, this will default to 990.
	Username string
	Passowrd string

	// If true, will connect un-encrypted, then upgrade to using AUTH TLS command.
	ExplicitTLS bool

	// If true, will NOT attempt to encrypt.
	InsecureUnencrypted bool

	TLSConfig *tls.Config
}

DialOptions for the FTPS client.

type File

type File struct {
	Name string
}

File of a directory list.

Jump to

Keyboard shortcuts

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