runtime

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyLocal

func CopyLocal(src, dst string) error

func CopyRemote

func CopyRemote(sshClient *ssh.Client, src, dst string) error

CopyRemote copies a file or directory recursively on the remote host using SFTP.

func ReadLocalFileBytes

func ReadLocalFileBytes(filename string) ([]byte, error)

func ReadRemoteFileBytes

func ReadRemoteFileBytes(sshClient *ssh.Client, remotePath string) ([]byte, error)

ReadRemoteFileBytes reads the content of a remote file as raw bytes using SFTP.

func RunLocalCommand

func RunLocalCommand(command, username string) (string, string, error)

func RunRemoteCommand

func RunRemoteCommand(client *ssh.Client, command, username string) (string, string, error)

RunRemoteCommand executes a command on a remote host using an existing SSH client connection.

func SetLocalFileMode

func SetLocalFileMode(path, modeStr string) error

func SetRemoteFileMode

func SetRemoteFileMode(sshClient *ssh.Client, path, modeStr string) error

SetRemoteFileMode sets the mode of a remote file using SFTP.

func StatLocal

func StatLocal(path string, follow bool) (os.FileInfo, error)

StatLocal retrieves local file information. If follow is true, it follows symlinks (os.Stat). If follow is false, it stats the link itself (os.Lstat).

func StatRemote

func StatRemote(sshClient *ssh.Client, path string) (os.FileInfo, error)

StatRemote retrieves remote file information using SFTP Lstat (does not follow symlinks). TODO: Implement follow=true for remote if needed (e.g., sftpClient.Stat or ReadLink+Stat)

func WriteLocalFile

func WriteLocalFile(filename string, data string) error

func WriteRemoteFile

func WriteRemoteFile(sshClient *ssh.Client, remotePath, data string) error

WriteRemoteFile writes data to a remote file using SFTP.

Types

This section is empty.

Jump to

Keyboard shortcuts

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