aassh

package module
v0.0.0-...-2f2b3c4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: BSD-2-Clause-Views Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSHClient

type SSHClient struct {
	// contains filtered or unexported fields
}

func NewSSHClient

func NewSSHClient(username, password, hostport string) (*SSHClient, error)

NewSSHClient returns a new SSHClient object. hostport should be in format server.name:22 password is optional. it is tried instead of keys if not blank

func (*SSHClient) Close

func (c *SSHClient) Close() error

Close closes the remote connection.

func (*SSHClient) PushBytes

func (c *SSHClient) PushBytes(b []byte, dest, perms string) error

PushBytes is used to push bytes from memory without writing a file first. dest should be the full remote path, and perms a typical permission string - eg "0644"

func (*SSHClient) PushDir

func (c *SSHClient) PushDir(src string, dest string, preserve bool) error

PushDir sends local folder src to remote host to folder dest. If preserve is set, timestamps are kept.

func (*SSHClient) PushFile

func (c *SSHClient) PushFile(src, dest string, preserve bool) error

PushFile sends local file src to remote host to file/folder dest. If preserve is set, timestamps are preserved.

func (*SSHClient) Receive

func (c *SSHClient) Receive(src, dest string) error

Receive receives a file or folder from remote host at location src, and writes it to local machine as dest.

func (*SSHClient) RunCmd

func (c *SSHClient) RunCmd(command string) (string, string, error)

RunCmd runs the command given on the host to which the connection is currently established. It returns stdout, stderr, and an error.

Jump to

Keyboard shortcuts

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