Versions in this module Expand all Collapse all v0 v0.3.0 Aug 1, 2023 Changes in this version type SSHConfig + SSHPrivateKey []byte v0.2.0 Aug 1, 2023 Changes in this version + func GetFileMd5(file string) (string, error) + func GetRemoteRevPath(localRootPath, remoteRootPath, localPath string, keepRemoteBaseDir bool) string + func SplitShellCommand(cmd string) []string type LocalCommand + func (r *LocalCommand) RunCommand(cmd string) (string, error) + func (r *LocalCommand) RunCommandInPipe(cmd string) (string, error) type SSH + func (r *SSH) Client() *ssh.Client + func (r *SSH) Download(src, dest string) error + func (r *SSH) RunInPipe(cmd string, args ...interface{}) (string, error) + func (r *SSH) Upload(src, dest string) error v0.1.0 Oct 6, 2021 Changes in this version + func GetFilePerm(fm fs.FileMode) string + func PrintfGreen(msg string, args ...interface{}) + func PrintfWhite(msg string, args ...interface{}) + func PrintfYellow(msg string, args ...interface{}) + func Run(req *RunRequest) error + func Walk(dir, dir2 string, f func(isDir bool, path, target string) error) error + type Command interface + Md5File func(file string) (string, error) + type Config struct + Server *ConfigServer + Tasks []*ConfigTask + func LoadConfig(file string) (*Config, error) + func (r *Config) ServerHost() string + type ConfigServer struct + Host string + User string + type ConfigTask struct + Cmd *ConfigTaskCmd + Copy *ConfigTaskCopy + Name string + func (r *ConfigTask) TaskType() TaskType + type ConfigTaskCmd struct + Commands []string + func (r *ConfigTaskCmd) UnmarshalYAML(unmarshal func(interface{}) error) error + func (r ConfigTaskCmd) MarshalYAML() (interface{}, error) + type ConfigTaskCopy struct + Dest string + Src string + type LocalCommand struct + func NewLocalCommand() *LocalCommand + func (r *LocalCommand) Md5File(file string) (string, error) + type RunRequest struct + Config string + type SSH struct + func NewSSH(config *SSHConfig) *SSH + func (r *SSH) Close() error + func (r *SSH) Dial() error + func (r *SSH) PrintMeta() + func (r *SSH) Run(cmd string) (string, error) + func (r *SSH) WriteFile(bs []byte, filemode string, filename string) (finalErr error) + type SSHCommand struct + Ins *SSH + func NewSSHCommand(sshIns *SSH) *SSHCommand + func (r *SSHCommand) Close() error + func (r *SSHCommand) CopyFile(src, dest string) (bool, error) + func (r *SSHCommand) CreateDir(dir, filemode string) error + func (r *SSHCommand) Dial() error + func (r *SSHCommand) Md5File(file string) (string, error) + func (r *SSHCommand) Run(cmd string) (string, error) + type SSHConfig struct + Host string + User string + type TaskType string + const TaskTypeCmd + const TaskTypeCopy