ssh

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(
	forward types.DialCloser,
	dialHost types.HostOption,
) (*ssh.Client, error)

func New

func New(opts types.HostOptions) (types.Host, error)

Types

type Host

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

func (*Host) Close

func (h *Host) Close() error

func (*Host) DownloadDirectory

func (h *Host) DownloadDirectory(
	ctx context.Context,
	from string,
) (types.DirectoryReadCloser, error)

func (*Host) DownloadFile

func (h *Host) DownloadFile(
	ctx context.Context,
	from string,
) (types.FileReadCloser, error)

func (*Host) Execute

func (h *Host) Execute(
	ctx context.Context,
	cmd string,
	args ...string,
) error

func (*Host) ExecuteWithOutput

func (h *Host) ExecuteWithOutput(
	ctx context.Context,
	cmd string,
	args ...string,
) ([]byte, error)

func (*Host) Shell

func (h *Host) Shell(
	ctx context.Context,
	cmdArgs ...string,
) (types.Terminal, error)

func (*Host) State

func (h *Host) State(ctx context.Context) (types.HostStatus, error)

func (*Host) UploadDirectory

func (h *Host) UploadDirectory(
	ctx context.Context,
	from types.DirectoryReader,
	to string,
) error

func (*Host) UploadFile

func (h *Host) UploadFile(
	ctx context.Context,
	from types.FileReader,
	to string,
) (err error)

type Terminal

type Terminal struct {
	io.WriteCloser
	io.Reader
	// contains filtered or unexported fields
}

func (*Terminal) Close

func (t *Terminal) Close() error

func (*Terminal) Execute

func (t *Terminal) Execute(cmd string, args ...string) error

func (*Terminal) ExecuteWithOutput

func (t *Terminal) ExecuteWithOutput(
	cmd string,
	args ...string,
) ([]byte, error)

Jump to

Keyboard shortcuts

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