Documentation ¶
Overview ¶
Copyright © NGR Softlab 2020-2024
Copyright © NGR Softlab 2020-2024 ¶
Copyright © NGR Softlab 2020-2024 ¶
Copyright © NGR Softlab 2020-2024
Index ¶
- func GetCommandOutWithErr(connParams ConnectParams, kill chan *os.Signal, ...) (output []byte, errOutput []byte, duration time.Duration, err error)
- func GetSudoCommandsOutWithoutErr(connParams ConnectParams, timeoutConn, timeoutCmd time.Duration, ...) (output []byte, err error)
- func LocalExecContext(timeout time.Duration, command string, params ...string) (output []byte, err error)
- func SendFileWithScp(connParams ConnectParams, kill chan *os.Signal, ...) (time.Duration, error)
- type ConnectParams
- type Connection
- func (conn *Connection) SendOneCommandWithErrOut(kill chan *os.Signal, command string) ([]byte, []byte, time.Duration, error)
- func (conn *Connection) SendScpFile(kill chan *os.Signal, pathParams FilePathParams) (time.Duration, error)
- func (conn *Connection) SendSudoCommandsWithoutErrOut(commands ...string) ([]byte, error)
- func (conn *Connection) SendSudoPassword(in io.WriteCloser, out io.Reader, output *[]byte)
- type FilePathParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCommandOutWithErr ¶
func GetCommandOutWithErr(connParams ConnectParams, kill chan *os.Signal, timeoutConn, timeoutCmd time.Duration, command string) (output []byte, errOutput []byte, duration time.Duration, err error)
GetCommandOutWithErr get result command output (with errOut) from ssh connection
func GetSudoCommandsOutWithoutErr ¶
func GetSudoCommandsOutWithoutErr(connParams ConnectParams, timeoutConn, timeoutCmd time.Duration, commands ...string) (output []byte, err error)
GetSudoCommandsOutWithoutErr get result sudo (!) commands... output from ssh connection
func LocalExecContext ¶
func LocalExecContext(timeout time.Duration, command string, params ...string) (output []byte, err error)
LocalExecContext local execution command with context
func SendFileWithScp ¶
func SendFileWithScp(connParams ConnectParams, kill chan *os.Signal, timeoutConn, timeoutCmd time.Duration, pathParams FilePathParams) (time.Duration, error)
SendFileWithScp get result command output (with errOut) from ssh connection
Types ¶
type ConnectParams ¶
ConnectParams params for ssh connection
type Connection ¶
Connection ssh connection struct
func GetSshConnection ¶
func GetSshConnection(connParams ConnectParams, timeout time.Duration) (connection *Connection, err error)
GetSshConnection getting ssh connection
func (*Connection) SendOneCommandWithErrOut ¶
func (conn *Connection) SendOneCommandWithErrOut(kill chan *os.Signal, command string) ([]byte, []byte, time.Duration, error)
SendOneCommandWithErrOut sending one command (no SUDO, with strErr output, with killChan)
func (*Connection) SendScpFile ¶
func (conn *Connection) SendScpFile(kill chan *os.Signal, pathParams FilePathParams) (time.Duration, error)
SendScpFile sending file (content = file string content) to rootFolder/folderName/fileName with scp
func (*Connection) SendSudoCommandsWithoutErrOut ¶
func (conn *Connection) SendSudoCommandsWithoutErrOut(commands ...string) ([]byte, error)
SendSudoCommandsWithoutErrOut sending many commands (may be with SUDO, without strErr output)
func (*Connection) SendSudoPassword ¶
func (conn *Connection) SendSudoPassword(in io.WriteCloser, out io.Reader, output *[]byte)
SendSudoPassword checking for sudo password ask (with recovery, be careful)