sftp

package
v0.0.0-...-3c1f4a5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package sftp contains a go 1.16 conformance filesystem implementation for SSH file Transfer Protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

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

func Connect

func Connect(opts Options) (*FS, error)

func (*FS) Mkdir

func (f *FS) Mkdir(name string) error

Mkdir creates the specified directory. An error will be returned if a file or directory with the specified path already exists, or if the directory's parent folder does not exist (the method cannot create complete paths).

func (*FS) MkdirAll

func (f *FS) MkdirAll(name string) error

MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. If path is already a directory, MkdirAll does nothing and returns nil. If path contains a regular file, an error is returned

func (*FS) Open

func (f *FS) Open(name string) (fs.File, error)

func (*FS) OpenFile

func (f *FS) OpenFile(name string, flag int, perm os.FileMode) (fs.File, error)

func (*FS) ReadDir

func (f *FS) ReadDir(name string) ([]fs.DirEntry, error)

func (*FS) RemoveAll

func (f *FS) RemoveAll(name string) error

func (*FS) Sub

func (f *FS) Sub(dir string) (fs.FS, error)

type Options

type Options struct {
	Host     string
	Port     int // Port default is 22.
	User     string
	Password string
	Callback ssh.HostKeyCallback // Callback default is ssh.InsecureIgnoreHostKey which must be considered insecure.
}

Options to connect to an FTP over SSH service, respective the SSH file Transfer Protocol.

Jump to

Keyboard shortcuts

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