remotemanager

package
v0.0.0-...-6157915 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const PowershellExecutionErrorMessage = "powershell encountered an issue"
View Source
const WinRmPort = 5985
View Source
const WinRmTimeout = 120 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type RebootChecker

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

func NewRebootChecker

func NewRebootChecker(winrmRemoteManager RemoteManager) *RebootChecker

func (*RebootChecker) RebootHasFinished

func (rc *RebootChecker) RebootHasFinished() (bool, error)

Inspired by Hashicorp Packer waitForRestart

type RebootCheckerI

type RebootCheckerI interface {
	RebootHasFinished() (bool, error)
}

type RebootWaiter

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

func NewRebootWaiter

func NewRebootWaiter(poller poller.PollerI, rebootChecker RebootCheckerI) *RebootWaiter

func (*RebootWaiter) WaitForRebootFinished

func (rw *RebootWaiter) WaitForRebootFinished() error

type RemoteManager

type RemoteManager interface {
	UploadArtifact(source, destination string) error
	ExtractArchive(source, destination string) error
	ExecuteCommand(command string) (int, error)
	ExecuteCommandWithTimeout(command string, timeout time.Duration) (int, error)
	CanReachVM() error
	CanLoginVM() error
}

func NewWinRM

func NewWinRM(host string, username string, password string, clientFactory WinRMClientFactoryI) RemoteManager

type WinRM

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

func (*WinRM) CanLoginVM

func (w *WinRM) CanLoginVM() error

func (*WinRM) CanReachVM

func (w *WinRM) CanReachVM() error

func (*WinRM) ExecuteCommand

func (w *WinRM) ExecuteCommand(command string) (int, error)

func (*WinRM) ExecuteCommandWithTimeout

func (w *WinRM) ExecuteCommandWithTimeout(command string, timeout time.Duration) (int, error)

func (*WinRM) ExtractArchive

func (w *WinRM) ExtractArchive(source, destination string) error

func (*WinRM) UploadArtifact

func (w *WinRM) UploadArtifact(sourceFilePath, destinationFilePath string) error

type WinRMClient

type WinRMClient interface {
	Run(command string, stdout io.Writer, stderr io.Writer) (int, error)
	CreateShell() (*winrm.Shell, error)
}

type WinRMClientFactory

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

func NewWinRmClientFactory

func NewWinRmClientFactory(host, username, password string) *WinRMClientFactory

func (*WinRMClientFactory) Build

func (f *WinRMClientFactory) Build(timeout time.Duration) (WinRMClient, error)

type WinRMClientFactoryI

type WinRMClientFactoryI interface {
	Build(timeout time.Duration) (WinRMClient, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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