ssh

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SimpleExecute

func SimpleExecute(user, host, command string) error

SimpleExecute is a simpler way to execute commands via SSH using the ssh binary This is useful when we don't need the full SSH client

Types

type Client

type Client struct {
	Host string
	User string
	// contains filtered or unexported fields
}

Client represents an SSH client

func NewClient

func NewClient(user, host, configKeyPath string, jumpUser, jumpHost string) (*Client, error)

NewClient creates a new SSH client

func (*Client) CheckProtohostInstalled

func (c *Client) CheckProtohostInstalled() (bool, error)

CheckProtohostInstalled checks if protohost is installed on remote

func (*Client) Close

func (c *Client) Close() error

Close closes the SSH connection

func (*Client) Execute

func (c *Client) Execute(command string) (string, error)

Execute runs a command and returns the output

func (*Client) ExecuteInteractive

func (c *Client) ExecuteInteractive(command string) error

ExecuteInteractive runs a command and streams output to terminal

func (*Client) SCP

func (c *Client) SCP(localPath, remotePath string) error

SCP copies a file to the remote host

Jump to

Keyboard shortcuts

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