Versions in this module Expand all Collapse all v1 v1.0.1 Mar 8, 2024 Changes in this version + var ONCE_LEN = 128 * 1024 + type Context struct + Bar *mpb.Bar + Ctx context.Context + type Progress struct + func NewProgress() *Progress + func (p *Progress) NewInfiniteByesBar(name string) *mpb.Bar v1.0.0 Aug 9, 2023 Changes in this version + func Addr(ip, port string) string + func DisableLogColor() + func FileModeV1(root string) (string, error) + func FileModeV2(file os.FileInfo) string + func GetLogger(name string) *logHandle + func HostKey(ip string) (ssh.PublicKey, error) + func LoadConfigBytes(names ...string) ([]byte, error) + func MaxInt(a, b int) int + func MaxInt64(a, b int64) int64 + func MinInt(a, b int) int + func MinInt64(a, b int64) int64 + func NewSSH(node *Node) (*ssh.Client, error) + func ParseInt64(str string) (int64, error) + func ParseUnit32(str string) (uint32, error) + func RandName(root string) string + func SetLogLevel(lvl logrus.Level) + func SetOutFile(name string) + func SetOutput(w io.Writer) + func StatDir(root string) (entries []os.DirEntry, name, mode, atime, mtime string, isDir bool, err error) + func StatDirChild(root string) ([]os.DirEntry, error) + func StatDirMeta(root string) (name, mode, atime, mtime string, isDir bool, err error) + func StatFile(root string) (string, string, string, string, string, error) + func StatTimeV2(file os.FileInfo) (string, string) — darwin/amd64, linux/amd64, windows/amd64 + func SupportANSIColor(fd uintptr) bool + func WalkTree(ctx context.Context, scpChan *scpChan, rootParent, root, dstPath string) error + type Attr struct + Atime time.Time + Mode os.FileMode + Mtime time.Time + Name string + Size int64 + Typ CommandType + func (a *Attr) SetMode(str string) error + func (a *Attr) SetSize(str string) error + func (a *Attr) SetTime(aStr, mStr string) error + type CommandType = string + const C + const D + const E + const NULL + const T + type File struct + Atime string + IsDir bool + LocalPath string + Mode string + Mtime string + Name string + RemotePath string + Size string + func NewFile(name, localPath, remotePath, mode, atime, mtime, size string, dir bool) File + type LRMap struct + Local string + Remote string + type Node struct + Children []*Node + Host string + KeyPath string + LRMap []LRMap + Name string + Password string + Port string + Typ SCPWType + User string + func LoadConfig() ([]*Node, error) + type Resource struct + Path string + func NewResource(filePath string) (*Resource, error) + type SCP struct + KeepTime bool + TimeOption string + func NewSCP(cli *ssh.Client, keepTime bool) *SCP + func (scp *SCP) Get(ctx context.Context, srcPath, dstPath string) error + func (scp *SCP) GetAll(ctx context.Context, localPath, remotePath string) error + func (scp *SCP) Put(ctx context.Context, srcPath, dstPath string) error + func (scp *SCP) PutAll(ctx context.Context, srcPath, dstPath string) error + func (scp *SCP) PutAllExcludeRoot(ctx context.Context, srcPath, dstPath string) error + func (scp *SCP) PutDir(ctx context.Context, localPath, remotePath string) error + func (scp *SCP) SwitchScpwFunc(ctx context.Context, localPath, remotePath string, typ SCPWType) (err error) + type SCPWType = string + const GET + const PUT