sftp

package
v4.25.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package sftp will eventually contain all implementations of SFTP components (that are currently within ./internal/old)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostCallback

func HostCallback(s *Server) ssh.HostKeyCallback

HostCallback is called when setting up the connection to the SFTP server.

Types

type Credentials

type Credentials struct {
	Username       string
	Password       string
	PrivateKeyFile string
	PrivateKeyPass string
}

func (Credentials) GetClient

func (c Credentials) GetClient(fs fs.FS, address string) (*sftp.Client, error)

type HostAuthorityCallback

type HostAuthorityCallback func(ssh.PublicKey, string) bool

HostAuthorityCallback used when setting up the connection to the SFTP server.

func HostAuthCallback

func HostAuthCallback() HostAuthorityCallback

HostAuthCallback is called when setting up the connection to the SFTP server.

type IsRevokedCallback

type IsRevokedCallback func(cert *ssh.Certificate) bool

IsRevokedCallback used when setting up the connection to the SFTP server.

func CertCallback

func CertCallback(s *Server) IsRevokedCallback

CertCallback is called when setting up the connection to the SFTP server.

type Server

type Server struct {
	Address   string          // host:port
	Host      string          // IP address
	Port      string          // port
	IsSSH     bool            // true if server is running SSH on address:port
	Banner    string          // banner text, if any
	Cert      ssh.Certificate // server's certificate
	Hostname  string          // hostname
	PublicKey ssh.PublicKey   // server's public key
}

Server contains connection data for connecting to an SFTP server.

Jump to

Keyboard shortcuts

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