working commit
This commit is contained in:
+10
-6
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user