operator

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDfOutput

func ParseDfOutput(out string) (float64, error)

ParseDfOutput парсим строку комманды df -P TODO: translate

func ParseInt64Output

func ParseInt64Output(out string) (val int64, err error)

ParseInt64Output парсим одну строку с числом TODO: translate

func ParseOutput

func ParseOutput(out string) (val int64, err error)

Types

type SSHOperator

type SSHOperator struct {
	Config *easyssh.MakeConfig
}

func (*SSHOperator) Execute

func (r *SSHOperator) Execute(command string) (stdOut string, stdErr string, err error)

выполнить комманду на удаленном компьютере и вернуть результат как строка

func (*SSHOperator) NewSSHOperator

func (r *SSHOperator) NewSSHOperator(bastion *k3sv1alpha1.BastionNode)

NewSshConnection New SSH Connection

func (*SSHOperator) Run

func (r *SSHOperator) Run(command string) (done bool, err error)

Run command on remote machine

Example:

func (*SSHOperator) Stream

func (r *SSHOperator) Stream(command string, isPrint bool)

Stream returns one channel that combines the stdout and stderr of the command as it is run on the remote machine, and another that sends true when the command is done. The sessions and channels will then be closed.

isPrint - выводить результат на экран или в лог

Jump to

Keyboard shortcuts

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