|
|
|
@@ -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) { |
|
|
|
|