sftp

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagFile int = 1 << iota
	FlagDir
)

Variables

This section is empty.

Functions

func BuildSSHURL

func BuildSSHURL(host, port string) string

BuildSSHURL builds up a SSH URL to feed ssh @host: hostname @port: port

func PrivateKeyAuthMethod

func PrivateKeyAuthMethod(privateKeyPath string) ssh.AuthMethod

PrivateKeyAuthMethod returns a ssh.AuthMethod initialized with a private key @privateKeyPath: path to the private key to use

Types

type Client

type Client struct {
	sftp.Client
}

Client

func New

func New(host, port, username string, sams ...ssh.AuthMethod) (*Client, error)

New returns a new SFTP Client @host: hostname to connect to @port: port on the hostname @username: username to login @sams: list of ssh.AuthMethod to use

func (*Client) Find

func (sc *Client) Find(root string, flag int, patterns ...string) (iterChannel chan fswalker.WalkItem)
func (sc *Client) ResolveSymlink(path string) string

ResolveSymlink resolve a path and returns the path of the file pointed if it is a symlink @path: path to resolve

func (*Client) Walk

func (sc *Client) Walk(root string) <-chan fswalker.WalkItem

Walk walks recursively through the SFTP @root: root path to start walking through

Jump to

Keyboard shortcuts

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