ssh

package
v0.0.0-...-5cd1969 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSFTPClient

func NewSFTPClient(conn *ssh.Client, useConcurrency bool) (*sftpclient, error)

Types

type FileStat

type FileStat interface {
	IsDir() bool
	IsRegular() bool
}

type Options

type Options struct {
	Server          string
	Port            int
	User            string
	Password        string
	TrustServerHost bool
	SftpConcurrency bool
}

type SshSession

type SshSession interface {
	Stat(path string) (FileStat, error)
	SendDir(progress io.Writer, src, dst string) error
	SendFile(progress io.Writer, src, dst string) error
	Exec(cmdOutput io.Writer, cmd string, param ...string) error
	ReceiveRemoteFile(progress io.Writer, remoteSrc, dst string) error
	ReceiveRemoteDir(progress io.Writer, remoteDir, dst string) error
	RemoveFile(path string) error
	Mkdir(path string) error
	RemoveDirectory(path string) error
	RemoveAll(srcdir string) error
	SetSftpConcurrency(concurrency bool)
	Close()
}

func ConnectWithPassword

func ConnectWithPassword(opt Options) (SshSession, error)

type StatusError

type StatusError struct {
	Code uint32
	// contains filtered or unexported fields
}

func (*StatusError) Error

func (s *StatusError) Error() string

Jump to

Keyboard shortcuts

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