libssh

package
v0.5.56 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 19 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chmod

func Chmod(factory SshConfigFactory, remotePath string, mode os.FileMode) error

func DeleteRemoteFiles

func DeleteRemoteFiles(factory SshConfigFactory, paths ...string) error

func FilterProcessList

func FilterProcessList(output string, filter func(string) bool) ([]int, error)

func FindProcesses

func FindProcesses(factory SshConfigFactory, filter func(string) bool) ([]int, error)

func KillService

func KillService(factory SshConfigFactory, name string) error

func LaunchService

func LaunchService(factory SshConfigFactory, name, cfg string, sudo bool) error

func RemoteConsole

func RemoteConsole(factory SshConfigFactory, cmd string) error

func RemoteExec

func RemoteExec(sshConfig SshConfigFactory, cmd string) (string, error)

func RemoteExecAll

func RemoteExecAll(sshConfig SshConfigFactory, cmds ...string) (string, error)

func RemoteExecAllTo

func RemoteExecAllTo(sshConfig SshConfigFactory, out io.Writer, cmds ...string) error

func RemoteExecAllWithTimeout

func RemoteExecAllWithTimeout(sshConfig SshConfigFactory, timeout time.Duration, cmds ...string) (string, error)

func RemoteFileList

func RemoteFileList(factory SshConfigFactory, path string) ([]os.FileInfo, error)

func RemoteKill

func RemoteKill(factory SshConfigFactory, match string) error

func RemoteKillFilter

func RemoteKillFilter(factory SshConfigFactory, match string, anti string) error

func RemoteKillFilterF

func RemoteKillFilterF(factory SshConfigFactory, filter func(string) bool) error

func RemoteKillSignalFilterF

func RemoteKillSignalFilterF(factory SshConfigFactory, signal string, filter func(string) bool) error

func RemoteShell

func RemoteShell(factory SshConfigFactory) error

func RetrieveRemoteFiles

func RetrieveRemoteFiles(factory SshConfigFactory, localPath string, paths ...string) error

func SendData

func SendData(factory SshConfigFactory, data []byte, remotePath string) error

func SendFile

func SendFile(factory SshConfigFactory, localPath string, remotePath string) error

Types

type SshConfigFactory

type SshConfigFactory interface {
	Address() string
	Hostname() string
	Port() int
	User() string
	Config() *ssh.ClientConfig
	KeyPath() string
}

type SshConfigFactoryImpl

type SshConfigFactoryImpl struct {
	// contains filtered or unexported fields
}

func NewSshConfigFactory

func NewSshConfigFactory(user, keyPath, host string) *SshConfigFactoryImpl

func (*SshConfigFactoryImpl) Address

func (factory *SshConfigFactoryImpl) Address() string

func (*SshConfigFactoryImpl) Config

func (factory *SshConfigFactoryImpl) Config() *ssh.ClientConfig

func (*SshConfigFactoryImpl) Hostname

func (factory *SshConfigFactoryImpl) Hostname() string

func (*SshConfigFactoryImpl) KeyPath

func (factory *SshConfigFactoryImpl) KeyPath() string

func (*SshConfigFactoryImpl) Port

func (factory *SshConfigFactoryImpl) Port() int

func (*SshConfigFactoryImpl) User

func (factory *SshConfigFactoryImpl) User() string

type SyncBuffer added in v0.5.43

type SyncBuffer struct {
	// contains filtered or unexported fields
}

func (*SyncBuffer) Read added in v0.5.43

func (self *SyncBuffer) Read(data []byte) (int, error)

func (*SyncBuffer) String added in v0.5.43

func (self *SyncBuffer) String() string

func (*SyncBuffer) Write added in v0.5.43

func (self *SyncBuffer) Write(data []byte) (int, error)

type SyncWriter added in v0.5.43

type SyncWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func (*SyncWriter) Write added in v0.5.43

func (self *SyncWriter) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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