remote

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSSHPort     = "22"
	DefaultSSHUser     = "root"
	DefaultPermissions = "0777"
	TmpDir             = "/tmp"

	PatternIP   = "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$"
	PatternPort = "^\\d{1,5}$"
)

Variables

This section is empty.

Functions

func NewSSHClient

func NewSSHClient(ip, port, user, password string) (client *ssh.Client, err error)

func NewScpClient

func NewScpClient(ip, port, user, password string) (client scp.Client, err error)

func NewScpClientBySSH

func NewScpClientBySSH(sshClient *ssh.Client) (client scp.Client, err error)

func RunCommandRemote

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

func RunScriptRemote

func RunScriptRemote(sshClient *ssh.Client, scriptFile, permissions string, needClean bool) error

func Scp

func Scp(client scp.Client, localFile, remotePath, permissions string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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