ssh

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// User is a default user used for SSH connections.
	User = "root"

	// ConnectionTimeout is a default time SSH will wait while connecting to unreachable server.
	ConnectionTimeout = "30s"

	// RetryTimeout is a default time after we give up connecting to reachable server.
	RetryTimeout = "60s"

	// RetryInterval is a default time how long we wait between SSH connection attempts.
	RetryInterval = "1s"

	// Port is a default port used for SSH connections.
	Port = 22
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address           string `json:"address" yaml:"address"`
	Port              int    `json:"port" yaml:"port"`
	User              string `json:"user" yaml:"user"`
	Password          string `json:"password,omitempty" yaml:"password,omitempty"`
	ConnectionTimeout string `json:"connectionTimeout" yaml:"connectionTimeout"`
	RetryTimeout      string `json:"retryTimeout" yaml:"retryTimeout"`
	RetryInterval     string `json:"retryInterval" yaml:"retryInterval"`
	PrivateKey        string `json:"privateKey,omitempty" yaml:"privateKey,omitempty"`
}

Config represents SSH transport configuration

func BuildConfig

func BuildConfig(sshConfig *Config, defaults *Config) *Config

BuildConfig takes destination SSH configuration, struct with default values provided by the user and merges it together with global SSH default values.

func (*Config) New

func (d *Config) New() (transport.Transport, error)

New creates new instance of ssh struct

func (*Config) Validate

func (d *Config) Validate() error

Validate validates given configuration and returns on first encountered error

Jump to

Keyboard shortcuts

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