working commit

This commit is contained in:
2026-02-21 12:31:39 +02:00
parent 3220e2d78f
commit cd37a4508c
37 changed files with 354 additions and 319 deletions
+19 -19
View File
@@ -338,18 +338,18 @@ func (util *FileUtil) listFiles(common *CommonFileParams, params *ListFilesParam
if params.AsRegexp {
params.AsPrefix = false
}
var pathAs term.PathUsage
var pathUsage string
switch {
case params.AsRegexp:
pathAs = term.AsRegexp
pathUsage = term.AsRegexp
case params.AsPrefix:
pathAs = term.AsPrefix
pathUsage = term.AsPrefix
default:
pathAs = term.AsFinePath
pathUsage = term.AsFinePath
}
timeout := time.Duration(common.Timeout) * time.Second
ctx, _ := context.WithTimeout(context.Background(), timeout)
files, err := client.NewClient().ListFiles(ctx, params.Filepath, pathAs)
files, err := client.NewClient().ListFiles(ctx, params.Filepath, pathUsage)
if err != nil {
return res, err
}
@@ -464,18 +464,18 @@ func (util *FileUtil) exportFiles(common *CommonFileParams, params *ExportFilesP
if params.AsRegexp {
params.AsPrefix = false
}
var pathAs term.PathUsage
var pathUsage string
switch {
case params.AsRegexp:
pathAs = term.AsRegexp
pathUsage = term.AsRegexp
case params.AsPrefix:
pathAs = term.AsPrefix
pathUsage = term.AsPrefix
default:
pathAs = term.AsFinePath
pathUsage = term.AsFinePath
}
timeout := time.Duration(common.Timeout) * time.Second
ctx, _ := context.WithTimeout(context.Background(), timeout)
files, err := client.NewClient().ListFiles(ctx, params.Filepath, pathAs)
files, err := client.NewClient().ListFiles(ctx, params.Filepath, pathUsage)
if err != nil {
return res, err
}
@@ -553,18 +553,18 @@ func (util *FileUtil) listCollections(common *CommonFileParams, params *ListColl
if params.AsRegexp {
params.AsPrefix = false
}
var pathAs term.PathUsage
var pathUsage string
switch {
case params.AsRegexp:
pathAs = term.AsRegexp
pathUsage = term.AsRegexp
case params.AsPrefix:
pathAs = term.AsPrefix
pathUsage = term.AsPrefix
default:
pathAs = term.AsFinePath
pathUsage = term.AsFinePath
}
timeout := time.Duration(common.Timeout) * time.Second
ctx, _ := context.WithTimeout(context.Background(), timeout)
collecions, err := client.NewClient().ListCollections(ctx, params.Path, pathAs)
collecions, err := client.NewClient().ListCollections(ctx, params.Path, pathUsage)
if err != nil {
return res, err
}
@@ -603,14 +603,14 @@ func (util *FileUtil) deleteCollection(common *CommonFileParams, params *DeleteC
}
timeout := time.Duration(common.Timeout) * time.Second
ctx, _ := context.WithTimeout(context.Background(), timeout)
var pathAs term.PathUsage
var pathUsage string
switch {
case params.AsPrefix:
pathAs = term.AsPrefix
pathUsage = term.AsPrefix
default:
pathAs = term.AsFinePath
pathUsage = term.AsFinePath
}
files, err := client.NewClient().DeleteCollection(ctx, params.Path, pathAs, params.DryRun)
files, err := client.NewClient().DeleteCollection(ctx, params.Path, pathUsage, params.DryRun)
if err != nil {
return res, err
}