sftpconn

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package sftpconn opens SFTP connections.

Split out from the connectors because the interesting part is authentication and host key verification, and both are identical whether a channel is collecting files or writing them. Two copies would drift, and the half that drifted would be the half that stopped verifying.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	Client *sftp.Client
	// contains filtered or unexported fields
}

Conn is an open SFTP session.

func Dial

func Dial(s Settings) (*Conn, error)

Dial opens a connection.

func (*Conn) Close

func (c *Conn) Close() error

Close ends the session.

type Settings

type Settings struct {
	Host                     string
	User                     string
	Password                 string
	KeyFile                  string
	KeyPassphrase            string
	KnownHostsFile           string
	InsecureSkipHostKeyCheck bool
	Timeout                  time.Duration
}

Settings is what both connectors need in order to connect.

Jump to

Keyboard shortcuts

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