ssh

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Overview

Package ssh is a transport.Interface implementation, which forwards given addresses over specified SSH host.

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,omitempty"`
	Port              int    `json:"port,omitempty"`
	User              string `json:"user,omitempty"`
	Password          string `json:"password,omitempty"`
	ConnectionTimeout string `json:"connectionTimeout,omitempty"`
	RetryTimeout      string `json:"retryTimeout,omitempty"`
	RetryInterval     string `json:"retryInterval,omitempty"`
	PrivateKey        string `json:"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.Interface, 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