ssh

package
v0.0.0-...-1be1a9a Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Platform value.Platform
	// contains filtered or unexported fields
}

Client is thin wrapper around an ssh client which exposes some useful functionality required when setting up/performing benchmarks.

func NewClient

func NewClient(host string, config *value.SSHConfig) (*Client, error)

NewClient creates a new client which is connected to the provided host.

func (*Client) Close

func (c *Client) Close() error

Close releases an resources in use by this client.

func (*Client) ExecuteCommand

func (c *Client) ExecuteCommand(command value.Command) ([]byte, error)

ExecuteCommand is a wrapper with executes the given command on the remote machine.

func (*Client) FileExists

func (c *Client) FileExists(path string) bool

FileExists returns a boolean indicating whether a file with the given path exists on the remote machine.

func (*Client) FlushCaches

func (c *Client) FlushCaches() error

FlushCaches sync then flushes the caches on the remote machine; this allows for more consistent benchmark results.

func (*Client) InstallPackageAt

func (c *Client) InstallPackageAt(path string) error

InstallPackageAt installs the package at the provided path on the remote machine.

func (*Client) InstallPackages

func (c *Client) InstallPackages(packages ...string) error

InstallPackages uses the platform specific package manager to install the given package.

func (*Client) RemoveDirectory

func (c *Client) RemoveDirectory(path string) error

RemoveDirectory removes the directory at the given path on the remote machine.

func (*Client) RemoveFile

func (c *Client) RemoveFile(path string) error

RemoveFile removes the file at the given path on the remote machine.

func (*Client) SecureDownload

func (c *Client) SecureDownload(source, sink string) error

SecureDownload emulates the 'scp' command by downloaded the file at the provided path to the local machine.

func (*Client) SecureUpload

func (c *Client) SecureUpload(source, sink string) error

SecureUpload emulates the 'scp' command by uploading the file at the provided path to the remote server.

func (*Client) Sync

func (c *Client) Sync() error

Sync runs 'sync' on the remote machine ensuring all dirty package are written to disk.

func (*Client) UninstallPackages

func (c *Client) UninstallPackages(packages ...string) error

UninstallPackages uses the platform specific package manager to uninstall the given package.

Jump to

Keyboard shortcuts

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