ssh

package
v0.82.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package ssh provides simple SSH operations for SoundTouch speakers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Host string
	User string
}

Client wraps an SSH client to perform operations on SoundTouch speakers.

func NewClient

func NewClient(host string) *Client

NewClient creates a new SSH client for the given host. The default user is "root".

func (*Client) ReadDir

func (c *Client) ReadDir(remotePath string) (map[string][]byte, error)

ReadDir downloads all regular files under remotePath, returning a map of absolute remote path → file content. Missing or unreadable files are skipped.

func (*Client) ReadFile

func (c *Client) ReadFile(remotePath string) ([]byte, error)

ReadFile downloads the content of a file on the remote host. An empty file that causes cat to exit non-zero (a firmware quirk on some devices) is returned as empty bytes rather than an error.

func (*Client) Run

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

Run executes a command on the remote host and returns the combined stdout and stderr.

func (*Client) UploadContent

func (c *Client) UploadContent(content []byte, remotePath string) error

UploadContent uploads the given content to a file on the remote host using stdin piping.

Jump to

Keyboard shortcuts

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