Documentation
¶
Index ¶
- func DialContext(ctx context.Context, address string, options ...Option) (connection.Connection, error)
- func DialContextExplicitTLS(ctx context.Context, address string, tlsConfig *tls.Config, options ...Option) (connection.Connection, error)
- func DialContextTLS(ctx context.Context, address string, tlsConfig *tls.Config, options ...Option) (connection.Connection, error)
- func NewConnection(host string, dialer Dialer, conn net.Conn, textConn TextConnection, ...) (connection.Connection, error)
- type Conn
- type Dialer
- type Option
- type ServerConnection
- func (c *ServerConnection) Cd(path string) error
- func (c *ServerConnection) Download(ctx context.Context, path string) ([]byte, error)
- func (c *ServerConnection) EnableExplicitTLSMode() (err error)
- func (c *ServerConnection) IsDir(ctx context.Context, path string) (bool, error)
- func (c *ServerConnection) List(ctx context.Context, options *connection.ListOptions) (entries []*entities.Entry, err error)
- func (c *ServerConnection) Login(user, password string) error
- func (c *ServerConnection) Mkdir(path string) error
- func (c *ServerConnection) Move(oldPath string, newPath string) error
- func (c *ServerConnection) Ready() (err error)
- func (c *ServerConnection) RemoveDir(path string) error
- func (c *ServerConnection) RemoveFile(path string) error
- func (c *ServerConnection) Size(path string) (uint64, error)
- func (c *ServerConnection) Status() (*entities.Status, error)
- func (c *ServerConnection) Stop() (err error)
- func (c *ServerConnection) Upload(ctx context.Context, options *connection.UploadOptions) error
- type TextConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialContext ¶
func DialContext(ctx context.Context, address string, options ...Option) (connection.Connection, error)
func DialContextExplicitTLS ¶
func DialContextExplicitTLS(ctx context.Context, address string, tlsConfig *tls.Config, options ...Option) (connection.Connection, error)
func DialContextTLS ¶
func DialContextTLS(ctx context.Context, address string, tlsConfig *tls.Config, options ...Option) (connection.Connection, error)
func NewConnection ¶
func NewConnection( host string, dialer Dialer, conn net.Conn, textConn TextConnection, options ...Option, ) (connection.Connection, error)
Types ¶
type Option ¶
type Option func(conn *ServerConnection) error
func WithDisabledEPSV ¶
func WithDisabledEPSV() Option
func WithDisabledUTF8 ¶
func WithDisabledUTF8() Option
func WithTLSConfig ¶
func WithVerboseWriter ¶
type ServerConnection ¶
type ServerConnection struct {
// contains filtered or unexported fields
}
func (*ServerConnection) Cd ¶
func (c *ServerConnection) Cd(path string) error
func (*ServerConnection) EnableExplicitTLSMode ¶
func (c *ServerConnection) EnableExplicitTLSMode() (err error)
EnableExplicitTLSMode function enables TLS modes on established TCP connection.
func (*ServerConnection) List ¶
func (c *ServerConnection) List(ctx context.Context, options *connection.ListOptions) (entries []*entities.Entry, err error)
func (*ServerConnection) Login ¶
func (c *ServerConnection) Login(user, password string) error
Login function authenticate user with provided account username and password. Upon successful authentication, server is then queried to list supported features to update connection settings at runtime.
func (*ServerConnection) Mkdir ¶
func (c *ServerConnection) Mkdir(path string) error
func (*ServerConnection) Move ¶
func (c *ServerConnection) Move(oldPath string, newPath string) error
func (*ServerConnection) Ready ¶
func (c *ServerConnection) Ready() (err error)
Ready function validates that the FTP server is ready to proceed.
func (*ServerConnection) RemoveDir ¶
func (c *ServerConnection) RemoveDir(path string) error
func (*ServerConnection) RemoveFile ¶
func (c *ServerConnection) RemoveFile(path string) error
func (*ServerConnection) Stop ¶
func (c *ServerConnection) Stop() (err error)
Stop function sends a quit command to FTP server and closes the TCP connection.
func (*ServerConnection) Upload ¶
func (c *ServerConnection) Upload(ctx context.Context, options *connection.UploadOptions) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.