splitted one operator module to file, account, image operators; splitted operator functions; etc
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user