Documentation ¶
Index ¶
- Constants
- Variables
- func CheckResults(crs chan string, ls int, wt *sync.WaitGroup, ccons chan struct{})
- func CmdExec(host, user, port, password, key, privilegeCmd, cmd, model string, force bool) error
- func CmdExecOut(host, user, port, password, key, privilegeCmd, cmd, model string, force bool) (string, error)
- func FileExists(path string) bool
- func GetIps(h []Host) []string
- func GetPerm(f *os.File) (perm string)
- func MakePath(path string) error
- func PathExists(path string) bool
- func PrintExecResult(res Result)
- func PrintPullResult(ip, src, dst string, err error)
- func PullFile(host, src, dst, user, port, password, key, model string, force bool)
- func PushFile(host, src, dst, user, port, password, key, model string, force bool)
- func SinglePull(host, src, dst, model string, cu *CommonUser, force bool)
- func SinglePush(ip, src, dst, model string, cu *CommonUser, f bool)
- func SingleRun(host, cmd, model string, user *CommonUser, force bool) error
- func SingleRunOut(host, cmd, model string, user *CommonUser, force bool) (string, error)
- type CommonUser
- type Host
- type Result
- type Scp
- type ScpConfig
- type Server
- func (server *Server) PRunCmd(crs chan Result)
- func (server *Server) PRunScp(crs chan Result)
- func (server *Server) PullScp() (err error)
- func (server *Server) RunCmd() (result string, err error)
- func (server *Server) RunScpDir() (err error)
- func (server *Server) SRunCmd() Result
- func (s *Server) SetCmd(cmd string)
Constants ¶
View Source
const ( SCP_PUSH_BEGIN_FILE = "C" SCP_PUSH_BEGIN_FOLDER = "D" SCP_PUSH_BEGIN_END_FOLDER = "0" SCP_PUSH_END_FOLDER = "E" SCP_PUSH_END = "\x00" )
View Source
const ( NO_EXIST = "0" IS_FILE = "1" IS_DIR = "2" DefaultCon = 5 Timeout = 600 )
Variables ¶
View Source
var (
NO_PASSWORD = "GET PASSWORD ERROR\n"
)
Functions ¶
func CheckResults ¶
func CmdExecOut ¶
func FileExists ¶
func PathExists ¶
func PrintExecResult ¶
func PrintExecResult(res Result)
func SinglePull ¶
func SinglePull(host, src, dst, model string, cu *CommonUser, force bool)
func SinglePush ¶
func SinglePush(ip, src, dst, model string, cu *CommonUser, f bool)
func SingleRunOut ¶
func SingleRunOut(host, cmd, model string, user *CommonUser, force bool) (string, error)
Types ¶
type CommonUser ¶
type CommonUser struct {
// contains filtered or unexported fields
}
func NewUser ¶
func NewUser(user, port, psw, key string, force bool) *CommonUser
type Result ¶
func ServersPush ¶
push file or dir to remote servers
func ServersRun ¶
func ServersRun(cmd string, cu *CommonUser, wt *sync.WaitGroup, crs chan machine.Result, ipFile string, ccons chan struct{}) {
type Scp ¶
type Scp struct {
// contains filtered or unexported fields
}
type Server ¶
type Server struct { Ip string Port string User string Psw string Key string Action string Cmd string FileName string RemotePath string Force bool SSHModel string }
func NewCmdServer ¶
func NewPullServer ¶
func NewScpServer ¶
Click to show internal directories.
Click to hide internal directories.