sshexec

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SshClient

func SshClient(host, 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
	NoLogs         bool
}

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) Start

func (c *Cmd) Start() error

func (*Cmd) String

func (c *Cmd) String() string

type Executor

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

func NewExecutor

func NewExecutor(client *ssh.Client) *Executor

func (*Executor) Addr

func (e *Executor) Addr() net.Addr

func (*Executor) Close

func (e *Executor) Close() error

func (*Executor) Start

func (e *Executor) Start(cmd string, in io.Reader, out, stderr io.Writer) error

func (*Executor) StartInteractive added in v0.1.0

func (e *Executor) StartInteractive(cmd string, in io.Reader, out, stderr io.Writer, h, w int) error

func (*Executor) Wait

func (e *Executor) Wait() error

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