working commit

This commit is contained in:
2026-02-18 23:55:55 +02:00
parent 13c8d50f53
commit 87354c7cdc
4 changed files with 22 additions and 2 deletions
+10 -1
View File
@@ -19,6 +19,7 @@ import (
"os"
"path/filepath"
"strconv"
"net/url"
"mstore/app/descr"
"mstore/pkg/auxhttp"
@@ -323,7 +324,7 @@ func (cli *Client) ListCollections(ctx context.Context, catalogURI string) ([]st
return res, err
}
func (cli *Client) DeleteCollection(ctx context.Context, catalogURI string) ([]descr.File, error) {
func (cli *Client) DeleteCollection(ctx context.Context, catalogURI string, isPattern bool) ([]descr.File, error) {
var err error
res := make([]descr.File, 0)
@@ -335,6 +336,14 @@ func (cli *Client) DeleteCollection(ctx context.Context, catalogURI string) ([]d
if err != nil {
return res, err
}
if isPattern {
values := url.Values{}
values.Add("isPattern","true")
catalogURI = catalogURI + "?" + values.Encode()
}
req, err := http.NewRequestWithContext(ctx, http.MethodDelete, catalogURI, nil)
if err != nil {
return res, err