Documentation
¶
Index ¶
- func GetFileMd5(file string) (string, error)
- func GetFilePerm(fm fs.FileMode) string
- func GetRemoteRevPath(localRootPath, remoteRootPath, localPath string, keepRemoteBaseDir bool) string
- func PrintfGreen(msg string, args ...interface{})
- func PrintfWhite(msg string, args ...interface{})
- func PrintfYellow(msg string, args ...interface{})
- func SplitShellCommand(cmd string) []string
- func Walk(dir, dir2 string, f func(isDir bool, path, target string) error) error
- type Command
- type LocalCommand
- type SSH
- func (r *SSH) Client() *ssh.Client
- func (r *SSH) Close() error
- func (r *SSH) Dial() error
- func (r *SSH) Download(src, dest string) error
- func (r *SSH) PrintMeta()
- func (r *SSH) Run(cmd string, args ...interface{}) (string, error)
- func (r *SSH) RunInPipe(cmd string, args ...interface{}) (string, error)
- func (r *SSH) Upload(src, dest string) error
- func (r *SSH) WriteFile(bs []byte, filemode string, filename string) (finalErr error)
- type SSHConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFileMd5 ¶ added in v0.2.0
func GetFilePerm ¶
func GetRemoteRevPath ¶ added in v0.2.0
func GetRemoteRevPath(localRootPath, remoteRootPath, localPath string, keepRemoteBaseDir bool) string
如果是 receive,则 keepRemoteBaseDir 需要传 true,来保留远程目录的最后一个子目录
func PrintfGreen ¶
func PrintfGreen(msg string, args ...interface{})
func PrintfWhite ¶
func PrintfWhite(msg string, args ...interface{})
func PrintfYellow ¶
func PrintfYellow(msg string, args ...interface{})
func SplitShellCommand ¶ added in v0.2.0
Types ¶
type LocalCommand ¶
type LocalCommand struct{}
func NewLocalCommand ¶
func NewLocalCommand() *LocalCommand
func (*LocalCommand) RunCommand ¶ added in v0.2.0
func (r *LocalCommand) RunCommand(cmd string) (string, error)
func (*LocalCommand) RunCommandInPipe ¶ added in v0.2.0
func (r *LocalCommand) RunCommandInPipe(cmd string) (string, error)
type SSH ¶
type SSH struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.