You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.8 KiB

  1. package cos
  2. import (
  3. "context"
  4. "encoding/xml"
  5. "net/http"
  6. )
  7. // ListMultipartUploadsResult ...
  8. type ListMultipartUploadsResult struct {
  9. XMLName xml.Name `xml:"ListMultipartUploadsResult"`
  10. Bucket string `xml:"Bucket"`
  11. EncodingType string `xml:"Encoding-Type"`
  12. KeyMarker string
  13. UploadIDMarker string `xml:"UploadIdMarker"`
  14. NextKeyMarker string
  15. NextUploadIDMarker string `xml:"NextUploadIdMarker"`
  16. MaxUploads int
  17. IsTruncated bool
  18. Uploads []struct {
  19. Key string
  20. UploadID string `xml:"UploadId"`
  21. StorageClass string
  22. Initiator *Initiator
  23. Owner *Owner
  24. Initiated string
  25. } `xml:"Upload,omitempty"`
  26. Prefix string
  27. Delimiter string `xml:"delimiter,omitempty"`
  28. CommonPrefixes []string `xml:"CommonPrefixs>Prefix,omitempty"`
  29. }
  30. // ListMultipartUploadsOptions ...
  31. type ListMultipartUploadsOptions struct {
  32. Delimiter string `url:"delimiter,omitempty"`
  33. EncodingType string `url:"encoding-type,omitempty"`
  34. Prefix string `url:"prefix,omitempty"`
  35. MaxUploads int `url:"max-uploads,omitempty"`
  36. KeyMarker string `url:"key-marker,omitempty"`
  37. UploadIDMarker string `url:"upload-id-marker,omitempty"`
  38. }
  39. // ListMultipartUploads ...
  40. //
  41. // List Multipart Uploads用来查询正在进行中的分块上传。单次最多列出1000个正在进行中的分块上传。
  42. //
  43. // https://www.qcloud.com/document/product/436/7736
  44. func (s *BucketService) ListMultipartUploads(ctx context.Context, opt *ListMultipartUploadsOptions) (*ListMultipartUploadsResult, *Response, error) {
  45. var res ListMultipartUploadsResult
  46. sendOpt := sendOptions{
  47. baseURL: s.client.BaseURL.BucketURL,
  48. uri: "/?uploads",
  49. method: http.MethodGet,
  50. result: &res,
  51. optQuery: opt,
  52. }
  53. resp, err := s.client.send(ctx, &sendOpt)
  54. return &res, resp, err
  55. }