remote

package
v0.0.0-...-11ca375 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package remote ssh'es into remote machines and runs a command

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCommandWithPipes

func RunCommandWithPipes(cmd string, e Executor) (string, error)

RunCommandWithPipes runs consecutive remote commands that have |

Types

type Executor

type Executor interface {
	SetupKeys(string) error
	CreateClient() error
	CreateSession(string) (SSHSessionInterface, error)
	Run(string, SSHSessionInterface) (string, error)
	Close() error
}

Executor interface for executing remote commands

func NewRemote

func NewRemote(ipaddr, user string, port int32, usageMetricsLogger agentstatus.AgentStatus) Executor

NewRemote attempts to find connect to remote ssh server with private key

type SSHClientInterface

type SSHClientInterface interface {
	ssh.Conn

	NewSession() (*ssh.Session, error)
}

SSHClientInterface abstracts the client struct from ssh package

type SSHSessionInterface

type SSHSessionInterface interface {
	Output(string) ([]byte, error)
	Close() error
}

SSHSessionInterface abstracts the session struct from ssh package

Jump to

Keyboard shortcuts

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