remote_sync

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(projectConf map[string]string, sshType string) *ssh.Client

func Disconnect

func Disconnect(conn *ssh.Client)

func DownloadFile

func DownloadFile(scp *sftp.Client, remoteFile, localFile string, imagesOnly, compress bool) (err error)

func ListFiles

func ListFiles(chDownload *sync.WaitGroup, ch chan bool, remoteDir, subdir string, indx int, imagesOnly, compress bool) (err error)

func NewClient

func NewClient(conn *ssh.Client) *sftp.Client

func RunCommand

func RunCommand(conn *ssh.Client, cmd string) string

func RunCommandSafe

func RunCommandSafe(conn *ssh.Client, cmd string) (string, error)

RunCommandSafe runs a remote command and returns its combined output together with any error, without aborting the process. Use it for optional probes (e.g. checking whether a binary exists on the remote host).

func SetSSHConfigProvider

func SetSSHConfigProvider(p SSHConfigProvider)

SetSSHConfigProvider sets a custom provider for creating SSH client configurations.

Types

type RemoteDbStruct

type RemoteDbStruct struct {
	Host           string `json:"host"`
	Dbname         string `json:"dbname"`
	Username       string `json:"username"`
	Password       string `json:"password"`
	Active         string `json:"active"`
	Model          string `json:"model"`
	Engine         string `json:"engine"`
	InitStatements string `json:"initStatements"`
	Port           string `json:"port"`
}

type SSHConfigProvider

type SSHConfigProvider interface {
	ClientConfig(host, port, user, password, keyPath string) (*ssh.ClientConfig, error)
}

SSHConfigProvider allows enterprise to customize SSH client configuration. For example, to verify host keys via known_hosts or use certificate-based auth.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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