sftpclient

package
v0.0.0-...-63016fa Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 5 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 {
	// contains filtered or unexported fields
}

Client is a wrapper for sftp.Client that handles ssh connection. Close method closes both sftp and ssh connections.

func (*Client) Close

func (c *Client) Close() error

Close closes both sftp and ssh connections. Must be called after Connect. After Close(), other methods should not be called.

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, address string, sshConf *ssh.ClientConfig) error

Connect connects to the address with ssh client config and constructs sftp client.

func (*Client) OpenFile

func (c *Client) OpenFile(path string, flags int) (*sftp.File, error)

OpenFile opens the file with flags. See sftp.OpenFile for details. Must be called after Connect.

Jump to

Keyboard shortcuts

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