kssh

package
v0.0.0-...-9542606 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = time.Minute

DefaultTimeout is the 1 minute for ssh.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSH

type SSH struct {
	User       string
	Password   string
	PkFile     string
	PkPassword string
	Timeout    time.Duration
}

func NewSSH

func NewSSH(user, password, pkFile, pkPassword string, timeout time.Duration) *SSH

NewSSH returns a new SSH struct.

func (*SSH) Cmd

func (ss *SSH) Cmd(host string, cmd string) string

Cmd is in host exec cmd

func (*SSH) CmdAsync

func (ss *SSH) CmdAsync(host string, cmd string) error

异步执行命令

func (*SSH) Copy

func (ss *SSH) Copy(host, localFilePath, remoteFilePath string)

func (*SSH) NewSession

func (ss *SSH) NewSession(host string) (*ssh.Session, error)

NewSession returns a new session.

Jump to

Keyboard shortcuts

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