Browse Source

查询对象列表接口支持只非递归查询

feature_wq
Sydonian 1 year ago
parent
commit
1e2e2e4b0d
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      sdks/storage/cdsapi/object.go

+ 8
- 5
sdks/storage/cdsapi/object.go View File

@@ -28,13 +28,16 @@ func (c *Client) Object() *ObjectService {
const ObjectListPathByPath = "/object/listByPath"

type ObjectListByPath struct {
UserID cdssdk.UserID `form:"userID" binding:"required"`
PackageID cdssdk.PackageID `form:"packageID" binding:"required"`
Path string `form:"path"` // 允许为空字符串
IsPrefix bool `form:"isPrefix"`
UserID cdssdk.UserID `form:"userID" binding:"required"`
PackageID cdssdk.PackageID `form:"packageID" binding:"required"`
Path string `form:"path"` // 允许为空字符串
IsPrefix bool `form:"isPrefix"`
NoRecursive bool `form:"noRecursive"` // 仅当isPrefix为true时有效,表示仅查询直接属于Prefix下的对象,对于更深的对象,返回它们的公共前缀

}
type ObjectListByPathResp struct {
Objects []cdssdk.Object `json:"objects"`
CommonPrefixes []string `json:"commonPrefixes"` // 仅在IsPrefix为true且NoRecursive为true时有效,包含更深层对象的shared prefix
Objects []cdssdk.Object `json:"objects"` // 如果IsPrefix为true且NoRecursive为false,则返回所有匹配的对象,否则只返回直接属于Prefix下的对象
}

func (c *ObjectService) ListByPath(req ObjectListByPath) (*ObjectListByPathResp, error) {


Loading…
Cancel
Save