machine

package
v0.0.0-...-10b7c71 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NO_EXIST = "0"
	IS_FILE  = "1"
	IS_DIR   = "2"
)

Variables

View Source
var (
	PASSWORD_SOURCE = "db"

	NO_PASSWORD = "GET PASSWORD ERROR\n"
)

Functions

This section is empty.

Types

type Result

type Result struct {
	Ip     string
	Cmd    string
	Result string
	Err    error
}

type ScpConfig

type ScpConfig struct {
	Src string
	Dst string
}

type Server

type Server struct {
	Ip         string
	Port       string
	User       string
	Psw        string
	Action     string
	Cmd        string
	FileName   string
	RemotePath string
	Force      bool
	Timeout    int
}

func NewCmdServer

func NewCmdServer(ip, port, user, psw, action, cmd string, force bool, timeout int) *Server

func NewPullServer

func NewPullServer(ip, port, user, psw, action, file, rpath string, force bool) *Server

func NewScpServer

func NewScpServer(ip, port, user, psw, action, file, rpath string, force bool, timeout int) *Server

func (*Server) PRunCmd

func (server *Server) PRunCmd(crs chan Result)

run command for parallel

func (*Server) PRunScp

func (server *Server) PRunScp(crs chan Result)

PRunScp() can transport file or path to remote host

func (*Server) PullScp

func (server *Server) PullScp() (err error)

pull file from remote to local server

func (*Server) RunCmd

func (server *Server) RunCmd() (result string, err error)

run command in sequence

func (*Server) RunScpDir

func (server *Server) RunScpDir() (err error)

func (*Server) RunScpFile

func (server *Server) RunScpFile() (result string, err error)

RunScp1() only can transport file to remote host

func (*Server) SRunCmd

func (server *Server) SRunCmd() Result

run command in sequence

func (*Server) SetCmd

func (s *Server) SetCmd(cmd string)

set Server.Cmd

func (*Server) SetPsw

func (server *Server) SetPsw()

query password from password plugin PASSWORD_SOURCE: db|web

Jump to

Keyboard shortcuts

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