ssh

package
v0.0.0-...-6862e2e Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(config Config) (*Client, error)

func (*Client) Close

func (client *Client) Close()

Close closes the underlying network connection

func (*Client) Get

func (client *Client) Get(remotefile string, localfile string) error

Get copies the file from the remote host to the local host, using scp. Wildcards are not currently supported.

func (*Client) Put

func (client *Client) Put(localfiles string, remotefile string) error

Put copies one or more local files to the remote host, using scp. localfiles can contain wildcards, and remotefile can be either a directory or a file.

func (*Client) Run

func (client *Client) Run(command string) (string, string, error)

type Config

type Config struct {
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
	Host     string `json:"host"`
	// The file names of additional key files to use for authentication (~/.ssh/id_rsa is defaulted).
	// RSA (PKCS#1), DSA (OpenSSL), and ECDSA private keys are supported.
	KeyFiles []string `json:"key_files,omitempty"`
}

func (Config) String

func (c Config) String() string

Jump to

Keyboard shortcuts

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