Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is an augmented SSH client.
func NewClient ¶
NewClient creates a new SSH client and a new SFTP client based on an SSH configuration and connects to it.
type Cmd ¶ added in v0.2.3
type Cmd struct {
Cmd string
Env map[string]string
Shell bool
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
}
Cmd describes a command to be executed on the remote host.
type Config ¶
type Config struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
User string `yaml:"user"`
Password string `yaml:"password"`
KeyFile string `yaml:"key-file"`
Key string `yaml:"key"`
Passphrase string `yaml:"passphrase"`
Fingerprint string `yaml:"fingerprint"`
HostKeyAlgorithms []string `yaml:"host-key-algorithms"`
KeyExchanges []string `yaml:"key-exchanges"`
Ciphers []string `yaml:"ciphers"`
MACs []string `yaml:"macs"`
}
Config is a flat configuration for an SSH connection.
type Option ¶
Option applies a configuration option for the execution of an operation.
func WithLogger ¶
WithLogger allows to use a custom logger.
func WithSTFPDisabled ¶ added in v1.2.0
func WithSTFPDisabled() Option
WithSTFPDisabled allows to disable the SFTP client.
func WithTimeout ¶
WithTimeout allows to set a custom timeout.
type Options ¶
type Options struct {
Logger *zerolog.Logger
Proxy *Client
Timeout time.Duration
STFPDisabled bool
}
Options contains the configuration for an operation.
func GetDefaultOptions ¶
func GetDefaultOptions() *Options
GetDefaultOptions returns the default options for all operations of this library.
Click to show internal directories.
Click to hide internal directories.