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