Documentation
¶
Index ¶
Constants ¶
const ( //RemoteImportPath - path to place the temporary remote import files when uploaded RemoteImportPath string = "/tmp/archive.backup" )
Variables ¶
This section is empty.
Functions ¶
func SafeCreate ¶
SafeCreate creates a file, creating parent directories if needed
func SafeCreateSSH ¶
func SafeCreateSSH(client SFTPClient, name ...string) (file *sftp.File, err error)
SafeCreateSSH creates a file, creating parent directories if needed on a remote machine via an ssh client
func SafeRemoveSSH ¶ added in v0.1.44
func SafeRemoveSSH(client SFTPClient, filePath string) (err error)
SafeRemoveSSH removes a file on a remote machine via an ssh client
Types ¶
type RemoteOperations ¶ added in v0.1.31
type RemoteOperations struct { GetSSHConnection func(command.SshConfig, *ssh.ClientConfig) (SFTPClient, error) // contains filtered or unexported fields }
RemoteOperations - an object which allows us to execute operations on a remote system
func NewRemoteOperations ¶
func NewRemoteOperations(sshCfg command.SshConfig) *RemoteOperations
NewRemoteOperations - a constructor for a remoteoperations object
func NewRemoteOperationsWithPath ¶ added in v0.1.41
func NewRemoteOperationsWithPath(sshCfg command.SshConfig, remoteImportPath string) *RemoteOperations
NewRemoteOperationsWithPath -
func (*RemoteOperations) GetRemoteFile ¶ added in v0.1.31
func (s *RemoteOperations) GetRemoteFile() (rfile io.WriteCloser, err error)
GetRemoteFile - get a file from a remote system and return a writecloser to it
func (*RemoteOperations) Path ¶ added in v0.1.31
func (s *RemoteOperations) Path() string
Path - allows us to get the path of the remote upload
func (*RemoteOperations) RemoveRemoteFile ¶ added in v0.1.44
func (s *RemoteOperations) RemoveRemoteFile() (err error)
RemoveRemoteFile - get a file from a remote system and return a writecloser to it
func (*RemoteOperations) SetPath ¶ added in v0.1.31
func (s *RemoteOperations) SetPath(p string)
SetPath - allows us to set the remote path of the upload
func (*RemoteOperations) UploadFile ¶ added in v0.1.31
func (s *RemoteOperations) UploadFile(lfile io.Reader) (err error)
UploadFile - allows us to upload the contents of the given reader