sshexec

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandError

type CommandError struct {
	Host    string
	Msg     string
	Code    int
	Command string
	// contains filtered or unexported fields
}

func (CommandError) Error

func (e CommandError) Error() string

func (CommandError) NotFound

func (e CommandError) NotFound() bool

func (CommandError) Unwrap

func (e CommandError) Unwrap() error

type SSH

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

func New

func New(host, user string, port int64) (*SSH, error)

func (*SSH) Host

func (s *SSH) Host() string

func (*SSH) ReadFile

func (s *SSH) ReadFile(path string) ([]byte, error)

func (*SSH) Run

func (s *SSH) Run(ctx context.Context, cmd string, options ...SessionOption) error

func (*SSH) WriteFile

func (s *SSH) WriteFile(path string, data []byte) error

type Service

type Service interface {
	Run(ctx context.Context, cmd string, options ...SessionOption) error

	ReadFile(path string) ([]byte, error)

	WriteFile(path string, data []byte) error

	Host() string
}

type SessionOption

type SessionOption func(o *sessionOptions)

func WithPty

func WithPty() SessionOption

func WithStderr

func WithStderr(w io.Writer) SessionOption

func WithStdin

func WithStdin(r io.Reader) SessionOption

func WithStdout

func WithStdout(w io.Writer) SessionOption

Jump to

Keyboard shortcuts

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