sftp

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Secret *katana.Secret
	Host   string
	User   string
	Key    []byte
	Path   string
	Mode   os.FileMode
}

Config is configuration for SFTP uploader

func (*Config) Validate

func (c *Config) Validate() error

Validate validates configuration

type SFTPUploader

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

SFTPUploader is SFTP uploader instance

func NewUploader

func NewUploader(config *Config) (*SFTPUploader, error)

NewUploader creates new SFTP uploader instance

func (*SFTPUploader) SetDispatcher

func (u *SFTPUploader) SetDispatcher(d *events.Dispatcher)

SetDispatcher sets events dispatcher

func (*SFTPUploader) Upload

func (u *SFTPUploader) Upload(file, fileName string) error

Upload uploads given file to SFTP storage

func (*SFTPUploader) Write added in v0.0.2

func (u *SFTPUploader) Write(r io.ReadCloser, fileName string, fileSize int64) error

Write writes data from given reader to given file

Jump to

Keyboard shortcuts

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