cmd

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package cmd contains the interface for running commands in packages such as iw and ping.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindCmdPath

func FindCmdPath(ctx context.Context, conn *ssh.Conn, cmd string) (string, error)

FindCmdPath returns full path for the binary on the given device, defined by its SSH connection.

Types

type RemoteCmdRunner

type RemoteCmdRunner struct {
	Host         *ssh.Conn
	NoLogOnError bool // Default false: dump log on error.
}

RemoteCmdRunner is the object used for running remote commands.

func (*RemoteCmdRunner) Output

func (r *RemoteCmdRunner) Output(ctx context.Context, cmd string, args ...string) ([]byte, error)

Output runs a command, waits for its completion and returns stdout output of the command.

func (*RemoteCmdRunner) Run

func (r *RemoteCmdRunner) Run(ctx context.Context, cmd string, args ...string) error

Run runs a command and waits for its completion.

Jump to

Keyboard shortcuts

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