xby_ssh

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MIT Imports: 8 Imported by: 0

README

#实际上应该搞成git上的库来操作

Documentation

Index

Constants

This section is empty.

Variables

View Source
var G_SSH_CLIENT *ssh.Client

Functions

func Init

func Init(config *ServerConfig)

func RunCmd

func RunCmd(script string) error

func RunCmdErrWithAfterCmd

func RunCmdErrWithAfterCmd(script string, afterCmd string)

func RunCmdErrWithExit

func RunCmdErrWithExit(script string)

func RunCmdErrWithNothing

func RunCmdErrWithNothing(script string)

func RunCmdGetData

func RunCmdGetData(script string) (res string)

func SSHConnect

func SSHConnect(user, password, host string, port int) (*ssh.Client, error)

Types

type ServerConfig

type ServerConfig struct {
	User     string `validate:"required"`
	Password string `validate:"required"`
	Host     string `validate:"required"`
	Port     int    `validate:"required"`
}

Jump to

Keyboard shortcuts

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