rcmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHostMatches

func GetHostMatches(re string, filename string) ([]string, error)

func GetSshClient

func GetSshClient(user string, keyfile string, targetUrl string) (*ssh.Client, error)

func PublicKeyFile

func PublicKeyFile(file string) ssh.AuthMethod

Types

type HostCmdRequest

type HostCmdRequest struct {
	Host       string
	SshUser    string
	SshKeyfile string
	Command    string
}

type HostCmdReturn

type HostCmdReturn struct {
	Host      string
	Stdout    string
	Stderr    string
	Timestamp string
}

func SshSession

func SshSession(user string, keyFile string, targetUrl string, cmd string) *HostCmdReturn

func (HostCmdReturn) Dump

func (hcr HostCmdReturn) Dump() []string

let's put in a method to make pretty output

type RunResult

type RunResult struct {
	Summary  map[string]int
	HostList []HostCmdReturn
}

func ProcessList

func ProcessList(hostList []string, numWorkers int, ssh_user string, ssh_keyfile string, cmd string, errOnly bool, rollSleepTime int) RunResult

func ProcessList2

func ProcessList2(hostList []string, numWorkers int, ssh_user string, ssh_keyfile string, cmd string, errOnly bool, rollSleepTime int) RunResult

Jump to

Keyboard shortcuts

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