Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
Conn wraps a net.Conn, and sets a deadline for every read and write operation.
type Host ¶
type Hosts ¶
func GetHosts ¶
GetHosts read the csv file and parse it's content to []*Host then init a *Hosts. Empty lines and lines starts with '#' will be ignored. The first column is remote ip, the second column is ssh port, the third column is ssh username(default is root), the forth column is password. The csv file must has at least the first column, then the default value of port and username will be 22 and root.
func (*Hosts) ExecuteSCP ¶
ExecuteSCP concurrently copy file/directory to remote hosts.
func (*Hosts) ExecuteSSH ¶
ExecuteSSH concurrently execute ssh command on remote hosts and print result.
func (Hosts) PrintResult ¶
func (hosts Hosts) PrintResult()
PrintResult fetch the executed hosts from channel and print their results. The results will be printed immediately after execution.