|
@@ -4,6 +4,7 @@ import (
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"git.sxidc.com/go-tools/api_binding/http_binding/response"
|
|
"git.sxidc.com/go-tools/api_binding/http_binding/response"
|
|
|
"net/url"
|
|
"net/url"
|
|
|
|
|
+ "strconv"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
const (
|
|
@@ -56,7 +57,7 @@ func (c *Client) DeleteNamespace(token string, baseUrl string, name string) erro
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func (c *Client) GetNamespaces(token string, baseUrl string, name string) ([]NamespaceInfo, error) {
|
|
|
|
|
|
|
+func (c *Client) GetNamespaces(token string, baseUrl string, name string, pageNo int, pageSize int) ([]NamespaceInfo, error) {
|
|
|
fullUrl, err := url.JoinPath(baseUrl, getNamespacesUrl)
|
|
fullUrl, err := url.JoinPath(baseUrl, getNamespacesUrl)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
@@ -65,7 +66,9 @@ func (c *Client) GetNamespaces(token string, baseUrl string, name string) ([]Nam
|
|
|
resp := new(response.InfosResponse[NamespaceInfo])
|
|
resp := new(response.InfosResponse[NamespaceInfo])
|
|
|
|
|
|
|
|
err = c.get(token, fullUrl, map[string]string{
|
|
err = c.get(token, fullUrl, map[string]string{
|
|
|
- "name": name,
|
|
|
|
|
|
|
+ "name": name,
|
|
|
|
|
+ "pageNo": strconv.Itoa(pageNo),
|
|
|
|
|
+ "pageSize": strconv.Itoa(pageSize),
|
|
|
}, resp)
|
|
}, resp)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, err
|
|
return nil, err
|