ssh

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package ssh provides SSH client functionality for connecting to QNAP devices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents an SSH client connection to a QNAP device

func NewClient

func NewClient(cfg Config) (*Client, error)

NewClient creates a new SSH client

func (*Client) Close

func (c *Client) Close() error

Close closes the SSH connection

func (*Client) Connect

func (c *Client) Connect() error

Connect establishes the SSH connection

func (*Client) Execute

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

Execute runs a command on the remote host and returns the output

func (*Client) ExecuteWithInput

func (c *Client) ExecuteWithInput(command string, input io.Reader) (string, error)

ExecuteWithInput runs a command with input and returns the output

func (*Client) IsConnected

func (c *Client) IsConnected() bool

IsConnected returns whether the client is connected

func (*Client) TestConnection

func (c *Client) TestConnection() error

TestConnection tests the SSH connection

type Config

type Config struct {
	Host     string
	Port     int
	Username string
	KeyFile  string
	Password string
	Timeout  time.Duration
}

Config represents SSH connection configuration

Jump to

Keyboard shortcuts

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