sftp

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(cfg Config) (*sftp.Client, error)

Dial returns a new SFTP client connected to the server described by cfg.

Types

type Config

type Config struct {
	Host           string
	Port           string // default "22"
	User           string
	Password       string // password auth (optional if key is set)
	PrivateKeyPath string // path to PEM-encoded private key (optional if password is set)
	BasePath       string
	// HostKeyCallback is called during the cryptographic handshake to
	// validate the server's host key. If nil, a default secure callback
	// is used that checks KnownHostsPath or the default system known_hosts.
	HostKeyCallback ssh.HostKeyCallback
	// KnownHostsPath is the path to the known_hosts file. If empty,
	// platform defaults are used (~/.ssh/known_hosts).
	KnownHostsPath string
}

Config holds the parameters needed to connect to an SFTP server.

Jump to

Keyboard shortcuts

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