sshexec

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SshClient

func SshClient(host string, port int, user, private, passphrase string) (*ssh.Client, error)

Types

type Cmd

type Cmd struct {
	Executor

	Name           string
	Args           []string
	Stdin          io.Reader
	Stdout, Stderr io.Writer
}

func Command

func Command(exec Executor, name string, args ...string) *Cmd

func (*Cmd) CombinedOutput

func (c *Cmd) CombinedOutput() (string, error)

func (*Cmd) Output

func (c *Cmd) Output() (string, error)

func (*Cmd) Run

func (c *Cmd) Run() error

func (*Cmd) RunInteractive added in v0.1.4

func (c *Cmd) RunInteractive(in io.Reader, out, stderr io.Writer, w, h int) error

func (*Cmd) Start

func (c *Cmd) Start() error

func (*Cmd) String

func (c *Cmd) String() string

type Executor

type Executor interface {
	Start(cmd string, in io.Reader, out, stderr io.Writer) error
	StartInteractive(cmd string, in io.Reader, out, stderr io.Writer, w, h int) error
	Wait() error
	Close() error
	Addr() string
	SetLogger(logger *slog.Logger)
}

func NewExecutor

func NewExecutor(host string, port int, user, private, passphrase string) Executor

type ExitError

type ExitError struct {
	Content string
	Status  int
}

func (ExitError) Error

func (e ExitError) Error() string

Jump to

Keyboard shortcuts

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