lwrunner

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

A runner package that executes commands on remote hosts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKnownHost added in v0.2.12

func AddKnownHost(host string, remote net.Addr, key ssh.PublicKey, knownFile string) (err error)

AddKnownHost adds a host to the provided known hosts file, if no known hosts file is provided, it will fallback to default known_hosts file

func CheckKnownHost added in v0.2.12

func CheckKnownHost(host string, remote net.Addr, key ssh.PublicKey, knownFile string) (found bool, err error)

CheckKnownHost checks if a host is in known hosts file, if no known hosts file is provided, it will fallback to default known_hosts file

func DefaultIdentityFilePath added in v0.2.12

func DefaultIdentityFilePath() (string, error)

func DefaultKnownHosts added in v0.2.12

func DefaultKnownHosts() (ssh.HostKeyCallback, error)

DefaultKnownHosts returns a host key callback from default known hosts path

func DefaultKnownHostsPath added in v0.2.12

func DefaultKnownHostsPath() (string, error)

DefaultKnownHostsPath returns default user ~/.ssh/known_hosts file

Types

type Runner added in v0.2.12

type Runner struct {
	Hostname string
	Port     int
	*ssh.ClientConfig
}

func New added in v0.2.12

func New(user, host string, callback ssh.HostKeyCallback) *Runner

func (*Runner) Address added in v0.2.12

func (run *Runner) Address() string

func (*Runner) Exec added in v0.2.12

func (run *Runner) Exec(cmd string) (stdout bytes.Buffer, stderr bytes.Buffer, err error)

Exec executes a command on the configured remote host

func (Runner) UseIdentityFile added in v0.2.12

func (run Runner) UseIdentityFile(file string) error

func (Runner) UsePassword added in v0.2.12

func (run Runner) UsePassword(secret string)

Jump to

Keyboard shortcuts

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