sftp

package
v0.0.0-...-5a0efe1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opt *Option) (driver.FS, error)

Types

type Option

type Option struct {
	base.Option
	Host       string `json:"host"        validate:"required"`
	Port       int    `json:"port"`
	Username   string `json:"username"    validate:"required"`
	Password   string `json:"password"    validate:"required_without=PrivateKey"`
	PrivateKey string `json:"private_key" validate:"required_without=Password"`
}

func (*Option) NewFS

func (opt *Option) NewFS() (driver.FS, error)

type SFTP

type SFTP struct {
	driver.Base
	// contains filtered or unexported fields
}

func (*SFTP) Close

func (d *SFTP) Close() error

func (*SFTP) Copy

func (d *SFTP) Copy(ctx context.Context, src, dst string) error

func (*SFTP) Create

func (d *SFTP) Create(path string) (driver.FileWriter, error)

func (*SFTP) Get

func (d *SFTP) Get(ctx context.Context, path string) (driver.File, error)

func (*SFTP) List

func (d *SFTP) List(ctx context.Context, path string, metas ...driver.Meta) ([]driver.File, error)

func (*SFTP) MakeDir

func (d *SFTP) MakeDir(ctx context.Context, path string) error

func (*SFTP) Move

func (d *SFTP) Move(ctx context.Context, src, dst string) error

func (*SFTP) Open

func (d *SFTP) Open(path string) (driver.FileReader, error)

func (*SFTP) Remove

func (d *SFTP) Remove(ctx context.Context, path string) error

func (*SFTP) Rename

func (d *SFTP) Rename(ctx context.Context, path, newName string) error

Jump to

Keyboard shortcuts

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