exec

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectoryExists

func DirectoryExists(machine Machine, io CommandInOut, fileName string) (bool, error)

func FileExists

func FileExists(machine Machine, io CommandInOut, fileName string) (bool, error)

func IsLocal

func IsLocal(m Machine) bool

func IsLocalHost

func IsLocalHost(host string) bool

func Mkdirs

func Mkdirs(machine Machine, io CommandInOut, dirName string) error

func PublicKey

func PublicKey(path string) (ssh.AuthMethod, error)

func Rsync

func Rsync(io CommandInOut, sourceMachine Machine, sourceRootDir, sourceRelativeDir string, destinationMachine Machine, destinationRootDir string, options []string) error

func Scp

func Scp(io CommandInOut, sourceMachine Machine, sourceFile string, destinationMachine Machine, destinationFile string) error

Types

type BufferedInOut

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

func NewBufferedInOut

func NewBufferedInOut() *BufferedInOut

func NewBufferedInOutWithLog

func NewBufferedInOutWithLog(log io.Writer) *BufferedInOut

func (*BufferedInOut) Err

func (s *BufferedInOut) Err() io.Writer

func (*BufferedInOut) GetCombinedOutput

func (s *BufferedInOut) GetCombinedOutput() string

func (*BufferedInOut) GetErr

func (s *BufferedInOut) GetErr() string

func (*BufferedInOut) GetLog

func (s *BufferedInOut) GetLog() string

func (*BufferedInOut) GetOut

func (s *BufferedInOut) GetOut() string

func (*BufferedInOut) In

func (s *BufferedInOut) In() io.Reader

func (*BufferedInOut) Log

func (s *BufferedInOut) Log() io.Writer

func (*BufferedInOut) Out

func (s *BufferedInOut) Out() io.Writer

type CommandExecutor

type CommandExecutor interface {
	ExecuteCmd(io CommandInOut, dir, command string, arg ...string) (string, error)
	RunCmd(io CommandInOut, dir, command string, arg ...string) error
}

type CommandInOut

type CommandInOut interface {
	Out() io.Writer
	Err() io.Writer
	Log() io.Writer
	In() io.Reader
}

func NewCommandInOut

func NewCommandInOut(out, err, log io.Writer, in io.Reader) CommandInOut

type Machine

type Machine interface {
	CommandExecutor
	User() string
	Host() string
	IpAddr() string
	Port() int
}

func NewLocalMachine

func NewLocalMachine(user string) Machine

func NewSshMachine added in v0.1.4

func NewSshMachine(hostname string, port int, sshConfig *ssh.ClientConfig) Machine

Jump to

Keyboard shortcuts

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