windows

package
v0.0.0-...-1624042 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Windows

type Windows struct {
	// Credentials is used for storing the credentials for Windows VMs created
	Credentials *credentials.Credentials
	// SSHClient contains the ssh client information to access the Windows VM via ssh
	SSHClient *ssh.Client
}

Windows represents a Windows host.

func (*Windows) CopyDirectory

func (w *Windows) CopyDirectory(localDir string, remoteDir string) error

func (*Windows) CopyFile

func (w *Windows) CopyFile(filePath, remoteDir string) error

func (*Windows) GetCredentials

func (w *Windows) GetCredentials() *credentials.Credentials

func (*Windows) GetSSHClient

func (w *Windows) GetSSHClient() error

GetSSHClient gets the ssh client associated with Windows VM created

func (*Windows) Reinitialize

func (w *Windows) Reinitialize() error

func (*Windows) RetrieveDirectories

func (w *Windows) RetrieveDirectories(remoteDir string, localDir string) error

RetrieveDirectories recursively copies the files and directories from the directory in the remote Windows VM to the given directory on the local host.

func (*Windows) Run

func (w *Windows) Run(cmd string, psCmd bool) (string, error)

type WindowsVM

type WindowsVM interface {
	// CopyDirectory copies the files from the directory on the local host to the directory on the remote Windows VM
	// This does not copy nested directories
	CopyDirectory(string, string) error
	// CopyFile copies the given file to the remote directory in the Windows VM. The remote directory is created if it
	// does not exist
	CopyFile(string, string) error
	// Run executes the given command remotely on the Windows VM over a ssh connection and returns the combined output
	// of stdout and stderr. If the bool is set, it implies that the cmd is to be execute in PowerShell. This function
	// should be used in scenarios where you want to execute a command that runs in the background. In these cases we
	// have observed that Run() returns before the command completes and as a result killing the process.
	Run(string, bool) (string, error)
	// GetCredentials returns the interface for accessing the VM credentials. It is up to the caller to check if non-nil
	// Credentials are returned before usage.
	GetCredentials() *credentials.Credentials
	// Reinitialize re-initializes the Windows VM. Presently only the ssh client is reinitialized.
	Reinitialize() error
}

WindowsVM is the interface for interacting with a Windows object created by the cloud provider

Jump to

Keyboard shortcuts

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