ssh

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	ActivateConfiguration(host Host, configuration string, action string) error
	MakeTempFile(host Host) (path string, err error)
	UploadFile(host Host, source string, destination string) error
	SetOwner(host Host, path string, user string, group string) error
	SetPermissions(host Host, path string, permissions string) error
	MoveFile(host Host, source string, destination string) error
	MakeDirs(host Host, path string, parents bool, mode os.FileMode) error
	WaitForMountPoints(host Host, path string) error

	Cmd(host Host, parts ...string) (*exec.Cmd, error)
	SudoCmd(host Host, parts ...string) (*exec.Cmd, error)
	CmdInteractive(host Host, timeout int, parts ...string)
}

type FileTransfer added in v1.2.0

type FileTransfer struct {
	Source      string
	Destination string
}

type Host

type Host interface {
	GetName() string
	GetTargetHost() string
	GetTargetPort() int
	GetTargetUser() string
}

type SSHContext

type SSHContext struct {
	AskForSudoPassword bool
	DefaultUsername    string
	IdentityFile       string
	ConfigFile         string
	SkipHostKeyCheck   bool
	// contains filtered or unexported fields
}

func (*SSHContext) ActivateConfiguration

func (ctx *SSHContext) ActivateConfiguration(host Host, configuration string, action string) error

func (*SSHContext) Cmd

func (sshCtx *SSHContext) Cmd(host Host, parts ...string) (*exec.Cmd, error)

func (*SSHContext) CmdContext added in v1.2.0

func (sshCtx *SSHContext) CmdContext(ctx context.Context, host Host, parts ...string) (*exec.Cmd, error)

func (*SSHContext) CmdInteractive

func (sshCtx *SSHContext) CmdInteractive(host Host, timeout int, parts ...string)

func (*SSHContext) GetBootID added in v1.2.0

func (sshCtx *SSHContext) GetBootID(host Host) (string, error)

func (*SSHContext) MakeDirs added in v1.1.0

func (ctx *SSHContext) MakeDirs(host Host, path string, parents bool, mode os.FileMode) (err error)

func (*SSHContext) MakeTempFile

func (ctx *SSHContext) MakeTempFile(host Host) (path string, err error)

func (*SSHContext) MoveFile

func (ctx *SSHContext) MoveFile(host Host, source string, destination string) (err error)

func (*SSHContext) SetOwner

func (ctx *SSHContext) SetOwner(host Host, path string, user string, group string) (err error)

func (*SSHContext) SetPermissions

func (ctx *SSHContext) SetPermissions(host Host, path string, permissions string) (err error)

func (*SSHContext) SudoCmd

func (sshCtx *SSHContext) SudoCmd(host Host, parts ...string) (*exec.Cmd, error)

func (*SSHContext) SudoCmdContext added in v1.2.0

func (sshCtx *SSHContext) SudoCmdContext(ctx context.Context, host Host, parts ...string) (*exec.Cmd, error)

func (*SSHContext) UploadFile

func (ctx *SSHContext) UploadFile(host Host, source string, destination string) (err error)

func (*SSHContext) WaitForMountPoints added in v1.7.0

func (ctx *SSHContext) WaitForMountPoints(host Host, path string) (err error)

Jump to

Keyboard shortcuts

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