Documentation
¶
Overview ¶
Package loom implements a set of functions to interact with remote servers using SSH. It is based on the Python fabric library.
Index ¶
- type Config
- func (config *Config) Get(remotefile string, localfile string) error
- func (config *Config) Local(cmd string) (string, error)
- func (config *Config) Put(localfiles string, remotefile string) error
- func (config *Config) PutString(data string, remotefile string) error
- func (config *Config) Run(cmd string) (string, error)
- func (config *Config) Sudo(cmd string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// The user name used in SSH connections. If not specified, the current user is assumed.
User string
// Password for SSH connections. This is optional. If the user has an ~/.ssh/id_rsa keyfile,
// that will also be tried. In addition, other key files can be specified.
Password string
// The machine:port to connect to.
Host string
// 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
// If true, send command output to stdout.
DisplayOutput bool
// If true, errors are fatal and will abort immediately.
AbortOnError bool
}
Config contains ssh and other configuration data needed for all the public functions in loom.
func (*Config) Get ¶
Get copies the file from the remote host to the local host, using scp. Wildcards are not currently supported.
func (*Config) Put ¶
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 (*Config) PutString ¶
PutString generates a new file on the remote host containing data. The file is created with mode 0644.
Click to show internal directories.
Click to hide internal directories.