ssh

package
v0.0.0-...-814fb87 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPort const
	DefaultPort = "22"
	// DefaultHostTimeout const
	DefaultHostTimeout = "30s"
	// DefaultHostKeepAlive const
	DefaultHostKeepAlive = "30s"
)
View Source
const DefaultPoolTimeout = "300s"

DefaultPoolTimeout const

Variables

View Source
var DefaultKeyPath string

DefaultKeyPath var

Functions

func GetUserHome

func GetUserHome() string

GetUserHome funct

func GhodssYAMLToMapInterface

func GhodssYAMLToMapInterface(in string) (map[string]interface{}, error)

GhodssYAMLToMapInterface func

func InterfaceToYAML

func InterfaceToYAML(in interface{}) (string, error)

InterfaceToYAML func

func SplitBySep

func SplitBySep(s string) []interface{}

SplitBySep func

func YAMLToInterface

func YAMLToInterface(in string, out interface{}) error

YAMLToInterface func

Types

type Dialer

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

Dialer struct

func NewDialer

func NewDialer(ctx context.Context, addr, user, pass, key, keyPass string, keyAgent bool, timeout, keepAlive string) (*Dialer, error)

NewDialer func

func (*Dialer) Close

func (c *Dialer) Close() error

Close funct

func (*Dialer) Dial

func (c *Dialer) Dial(ctx context.Context, network, addr string) (net.Conn, error)

Dial funct

type Host

type Host struct {
	Address      string `yaml:"address" json:"address,omitempty"`
	Port         string `yaml:"port" json:"port,omitempty"`
	User         string `yaml:"user" json:"user,omitempty"`
	Pass         string `yaml:"password" json:"password,omitempty"`
	SSHAgentAuth bool   `yaml:"ssh_agent_auth,omitempty" json:"sshAgentAuth,omitempty"`
	SSHKey       string `yaml:"ssh_key" json:"sshKey,omitempty"`
	SSHKeyPass   string `yaml:"ssh_key_pass" json:"sshKeyPass,omitempty"`
	SSHKeyPath   string `yaml:"ssh_key_path" json:"sshKeyPath,omitempty"`
	SSHCert      string `yaml:"ssh_cert" json:"sshCert,omitempty"`
	SSHCertPath  string `yaml:"ssh_cert_path" json:"sshCertPath,omitempty"`
	SSHTimeout   string `yaml:"ssh_timeout" json:"sshTimeout,omitempty"`
	SSHKeepAlive string `yaml:"ssh_keep_alive" json:"sshKeepAlive,omitempty"`
	// contains filtered or unexported fields
}

Host struct

func NewHostFromYAML

func NewHostFromYAML(config string) (*Host, error)

NewHostFromYAML func

func (*Host) Close

func (h *Host) Close() error

Close func

func (*Host) Dial

func (h *Host) Dial(ctx context.Context, network, addr string) (net.Conn, error)

Dial func

func (*Host) Run

func (h *Host) Run(ctx context.Context, cmds []string, kind string) ([]byte, error)

Run func

func (*Host) TunnelUp

func (h *Host) TunnelUp(ctx context.Context) error

TunnelUp func

type Pool

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

Pool struct

func NewPoolFromYAML

func NewPoolFromYAML(config string) (*Pool, error)

NewPoolFromYAML func

func (*Pool) Close

func (c *Pool) Close() error

Close func

func (*Pool) Run

func (c *Pool) Run() error

Run func

func (*Pool) RunCmd

func (c *Pool) RunCmd(cmd []string) error

RunCmd func

type PoolConfig

type PoolConfig struct {
	Hosts    []Host   `yaml:"hosts" json:"hosts,omitempty"`
	Cmds     []string `yaml:"cmds" json:"cmds,omitempty"`
	CmdFiles []string `yaml:"cmd_files,omitempty" json:"cmd_files,omitempty"`
	Timeout  string   `yaml:"timeout,omitempty" json:"timeout,omitempty"`
}

PoolConfig struct

func NewPoolConfigFromYAML

func NewPoolConfigFromYAML(config string) (*PoolConfig, error)

NewPoolConfigFromYAML func

Jump to

Keyboard shortcuts

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