Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
func Run(info *utils.WebHookInfo, hook *conf.HookConfig, key string, to int)
Types ¶
type ExecResult ¶
type ExecResult struct { Id int Host string Command string LocalFilePath string RemoteFilePath string Result string StartTime time.Time EndTime time.Time Error error }
result of the command execution
func CommandBySSH ¶
func CommandBySSH(host conf.HostConfig, to int, wg *sync.WaitGroup) (*ExecResult, error)
func CommandLocal ¶
type HostSession ¶
type HostSession struct { Username string Password string Hostname string Signers []ssh.Signer Port int Auths []ssh.AuthMethod }
ssh session
func (*HostSession) Exec ¶
func (exec *HostSession) Exec(command string, config ssh.ClientConfig) *ExecResult
运行远端主机脚本,并返回结果
func (*HostSession) GenerateConfig ¶
func (exec *HostSession) GenerateConfig() ssh.ClientConfig
生成ssh配置
Click to show internal directories.
Click to hide internal directories.