working commit

This commit is contained in:
2026-02-19 11:55:17 +02:00
parent 1fd55521de
commit bb0f58f46c
37 changed files with 231 additions and 150 deletions
+10 -6
View File
@@ -21,8 +21,9 @@ import (
"path/filepath"
"strconv"
"mstore/app/descr"
"mstore/pkg/auxhttp"
"mstore/pkg/descr"
"mstore/pkg/terms"
)
func (cli *Client) FileInfo(ctx context.Context, fileuri string) (bool, *descr.File, error) {
@@ -324,7 +325,7 @@ func (cli *Client) ListCollections(ctx context.Context, catalogURI string) ([]st
return res, err
}
func (cli *Client) DeleteCollection(ctx context.Context, catalogURI string, isPattern bool) ([]descr.File, error) {
func (cli *Client) DeleteCollection(ctx context.Context, catalogURI string, usePathAs terms.PathAs) ([]descr.File, error) {
var err error
res := make([]descr.File, 0)
@@ -336,10 +337,13 @@ func (cli *Client) DeleteCollection(ctx context.Context, catalogURI string, isPa
if err != nil {
return res, err
}
if isPattern {
values := url.Values{}
values.Add("isPattern", "true")
catalogURI = catalogURI + "?" + values.Encode()
values := url.Values{}
if usePathAs != "" {
values.Add("pathAs", string(usePathAs))
}
encodedValues := values.Encode()
if encodedValues != "" {
catalogURI = catalogURI + "?" + encodedValues
}
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, catalogURI, nil)