ssh

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2018 License: MIT Imports: 10 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

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

type Host

type Host interface {
	GetTargetHost() string
}

type SSHContext

type SSHContext struct {
	AskForSudoPassword bool
	Username           string
	IdentityFile       string
	// contains filtered or unexported fields
}

func (*SSHContext) ActivateConfiguration

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

func (*SSHContext) Cmd

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

func (*SSHContext) CmdInteractive

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

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 (ctx *SSHContext) SudoCmd(host Host, parts ...string) (*exec.Cmd, error)

func (*SSHContext) UploadFile

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

Jump to

Keyboard shortcuts

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