sftp

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(site midas.Site, deploymentSettings midas.DeploymentSettings, isDraft bool) (midas.Deployment, error)

Types

type Client

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

func NewClient

func NewClient(sshConfig midas.SFTPDeploymentSettings) *Client

NewClient creates a new SFTP client.

The Client.Connect method must be called before using the client.

func (*Client) Close

func (c *Client) Close() error

Close closes the connection to the remote server.

func (*Client) Connect

func (c *Client) Connect() error

Connect establishes a connection to the remote server using SFTP protocol using given configuration.

func (*Client) RemoteFiles

func (c *Client) RemoteFiles() (walk.FileMap, []error)

RemoteFiles returns a list of files in the remote directory.

func (*Client) RemoveEmptyDirs

func (c *Client) RemoveEmptyDirs() error

RemoveEmptyDirs removes empty directories from the remote server.

func (*Client) RemoveFile

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

RemoveFile removes a file from the remote server.

func (*Client) UploadNewFile

func (c *Client) UploadNewFile(filePath string, file *os.File) error

UploadNewFile creates a source file in the remote server.

type Deployment

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

func (*Deployment) Deploy

func (d *Deployment) Deploy() error

Deploy uploads the built files to the remote SFTP server.

Jump to

Keyboard shortcuts

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