client

package
v21.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConnectionTimeout = temporal.SSHConnectionTimeout()
	DefaultExecutionTimeout  = temporal.ExecutionTimeout()
)

DefaultTimeout tells to use the timeout by default depending on context

Functions

func DecorateTimeoutError

func DecorateTimeoutError(err error, action string, maySucceed bool) error

DecorateTimeoutError changes the error to something more comprehensible when timeout occurred

Types

type RemoteFileItem

type RemoteFileItem struct {
	Local        string
	Remote       string
	RemoteOwner  string
	RemoteRights string
}

RemoteFileItem is a helper struct to ease the copy of local files to remote

func (RemoteFileItem) RemoveRemote

func (rfc RemoteFileItem) RemoveRemote(clientSession *Session, hostname string) error

RemoveRemote deletes the remote file from host

func (RemoteFileItem) Upload

func (rfc RemoteFileItem) Upload(clientSession *Session, hostname string) error

Upload transfers the local file to the hostname

func (RemoteFileItem) UploadString

func (rfc RemoteFileItem) UploadString(clientSession *Session, content string, hostname string) error

UploadString transfers a string as file to the remote host

type RemoteFilesHandler

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

RemoteFilesHandler handles the copy of files and cleanup

func (*RemoteFilesHandler) Add

func (rfh *RemoteFilesHandler) Add(file *RemoteFileItem)

Add adds a RemoteFileItem in the handler

func (*RemoteFilesHandler) Cleanup

func (rfh *RemoteFilesHandler) Cleanup(clientSession *Session, hostname string)

Cleanup executes the removal of remote files. Note: Removal of local files is the responsibility of the caller, not the RemoteFilesHandler.

func (*RemoteFilesHandler) Count

func (rfh *RemoteFilesHandler) Count() uint

Count returns the number of files in the handler

func (*RemoteFilesHandler) Upload

func (rfh *RemoteFilesHandler) Upload(clientSession *Session, hostname string) error

Upload executes the copy of files

type Session

type Session struct {
	Bucket        bucket
	Cluster       cluster
	Host          host
	Image         image
	JobManager    jobManager
	Network       network
	SecurityGroup securityGroup
	Share         share
	SSH           ssh
	Subnet        subnet
	Template      template
	Tenant        tenant
	Volume        volume
	// contains filtered or unexported fields
}

Session units the different resources proposed by safescaled as safescale client

func New

func New(server string) (_ *Session, ferr fail.Error)

New returns an instance of safescale Client

func (*Session) Connect

func (s *Session) Connect()

Connect establishes connection with safescaled

func (*Session) Disconnect

func (s *Session) Disconnect()

Disconnect cuts the connection with safescaled

func (*Session) GetTask

func (s *Session) GetTask() (concurrency.Task, fail.Error)

GetTask ...

func (*Session) SetTask

func (s *Session) SetTask(task concurrency.Task) fail.Error

SetTask set the task the session must use

Jump to

Keyboard shortcuts

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