lib

package
v0.4.43 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 28 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chmod added in v0.4.1

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

func CopyFile

func CopyFile(srcPath, dstPath string) (int64, error)

func CopyTree

func CopyTree(srcPath, dstPath string) error

func DeleteRemoteFiles

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

func Export

func Export(path string, m *model.Model) 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 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 RemoteShell

func RemoteShell(factory SshConfigFactory) error

func RenderTemplate

func RenderTemplate(src, dst string, m *model.Model, data interface{}) error

func RenderTemplateFS

func RenderTemplateFS(srcFS fs.FS, src string, dst string, m *model.Model, data interface{}) error

func RetrieveRemoteFiles

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

func SendData added in v0.4.1

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

func SendFile

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

func StdoutTail

func StdoutTail(data []byte)

func SummarizeIperf

func SummarizeIperf(data []byte) (*model.IperfSummary, error)

func SummarizeIperfUdp

func SummarizeIperfUdp(data []byte) (*model.IperfUdpSummary, error)

func SummarizeSar

func SummarizeSar(data []byte) (*model.HostSummary, error)

func TemplateFuncMap

func TemplateFuncMap(m *model.Model) template.FuncMap

Types

type Process

type Process struct {
	Cmd    *exec.Cmd
	Output bytes.Buffer
	// contains filtered or unexported fields
}

func NewProcess

func NewProcess(name string, cmd ...string) *Process

func (*Process) Run

func (prc *Process) Run() error

func (*Process) WithTail

func (prc *Process) WithTail(tail TailFunction) *Process

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(h *model.Host) *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 TailFunction

type TailFunction func(data []byte)

Jump to

Keyboard shortcuts

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