sftp

package
v3.59.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CredentialsDocs

func CredentialsDocs() docs.FieldSpecs

CredentialsDocs returns a documentation field spec for SFTP credentials fields within a Config.

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 `json:"username" yaml:"username"`
	Password       string `json:"password" yaml:"password"`
	PrivateKeyFile string `json:"private_key_file" yaml:"private_key_file"`
	PrivateKeyPass string `json:"private_key_pass" yaml:"private_key_pass"`
}

Credentials contains the credentials for connecting to the SFTP server

func (Credentials) GetClient

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

GetClient establishes a fresh sftp client from a set of credentials and an address.

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