client

package
v22.11.9 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 34 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

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        bucketConsumer
	Cluster       clusterConsumer
	Host          hostConsumer
	Image         imageConsumer
	JobManager    jobConsumer
	Network       networkConsumer
	SecurityGroup securityGroupConsumer
	Share         shareConsumer
	SSH           sshConsumer
	Subnet        subnetConsumer
	Template      templateConsumer
	Tenant        tenantConsumer
	Label         labelConsumer
	Volume        volumeConsumer
	// contains filtered or unexported fields
}

Session units the different resources proposed by safescaled as safescale client

func New

func New(server, tenantID 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() (context.Context, fail.Error)

GetTask ...

func (*Session) SetTask

func (s *Session) SetTask(inctx context.Context) 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