findUploadIDs lists all incomplete uploads and find the uploadIDs of the matching object name.
(ctx context.Context, bucketName, objectName string)
| 1066 | |
| 1067 | // findUploadIDs lists all incomplete uploads and find the uploadIDs of the matching object name. |
| 1068 | func (c *Client) findUploadIDs(ctx context.Context, bucketName, objectName string) ([]string, error) { |
| 1069 | var uploadIDs []string |
| 1070 | // Make list incomplete uploads recursive. |
| 1071 | isRecursive := true |
| 1072 | // List all incomplete uploads. |
| 1073 | for mpUpload := range c.listIncompleteUploads(ctx, bucketName, objectName, isRecursive) { |
| 1074 | if mpUpload.Err != nil { |
| 1075 | return nil, mpUpload.Err |
| 1076 | } |
| 1077 | if objectName == mpUpload.Key { |
| 1078 | uploadIDs = append(uploadIDs, mpUpload.UploadID) |
| 1079 | } |
| 1080 | } |
| 1081 | // Return the latest upload id. |
| 1082 | return uploadIDs, nil |
| 1083 | } |
| 1084 | |
| 1085 | // listObjectPartsQuery (List Parts query) |
| 1086 | // - lists some or all (up to 1000) parts that have been uploaded |
no test coverage detected