splitted one operator module to file, account, image operators; splitted operator functions; etc

This commit is contained in:
2026-03-05 11:32:32 +02:00
parent 9ecd25ed0b
commit 80d6a244cf
54 changed files with 1049 additions and 826 deletions
+11 -11
View File
@@ -12,8 +12,8 @@ package filecmd
import (
"context"
"encoding/json"
"fmt"
"time"
"fmt"
"github.com/spf13/cobra"
@@ -50,7 +50,7 @@ func (util *FileUtil) listFiles(common *CommonFileParams, params *ListFilesParam
return res, err
}
ref.SetUserinfo(common.Username, common.Password)
ref.PathType(pathType(params.Regexp, params.Prefix))
ref.PathType(pathType(params.Regexp, params.Prefix))
mw := filecli.NewBasicAuthMiddleware(ref.Userinfo())
cli := filecli.NewClient(nil, mw)
@@ -58,7 +58,7 @@ func (util *FileUtil) listFiles(common *CommonFileParams, params *ListFilesParam
if err != nil {
return res, err
}
fmt.Printf("====%s\n", list)
fmt.Printf("====%s\n", list)
files := descr.NewFiles()
err = json.Unmarshal(list, files.ArrayPtr())
if err != nil {
@@ -73,12 +73,12 @@ func (util *FileUtil) listFiles(common *CommonFileParams, params *ListFilesParam
}
func pathType(regex, prefix bool) string {
switch {
case regex:
return filecli.PathTypeRegexp
case prefix:
return filecli.PathTypePrefix
default:
}
return filecli.PathTypeIdentic
switch {
case regex:
return filecli.PathTypeRegexp
case prefix:
return filecli.PathTypePrefix
default:
}
return filecli.PathTypeIdentic
}