You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2023/05/22 09:02:50 UTC
[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #2279: feat(services/oss): add append support
Xuanwo commented on code in PR #2279:
URL: https://github.com/apache/incubator-opendal/pull/2279#discussion_r1200213231
##########
core/src/services/oss/core.rs:
##########
@@ -186,6 +187,53 @@ impl OssCore {
Ok(req)
}
+ /// Oss append object request
+ ///
+ /// # Note
+ ///
+ /// This request is used to append data to an existing object or create an appendable object.
+ /// So you must set the `append` and `position` header.
+ ///
+ /// https://www.alibabacloud.com/help/object-storage-service/latest/appendobject
+ pub fn oss_append_object_request(
+ &self,
+ path: &str,
+ position: u64,
+ size: usize,
+ args: &OpAppend,
+ body: AsyncBody,
+ ) -> Result<Request<AsyncBody>> {
+ let p = build_abs_path(&self.root, path);
+ let endpoint = self.get_endpoint(false);
+ let url = format!("{}/{}", endpoint, percent_encode_path(&p));
+
+ let mut req = Request::post(&url);
+
+ // The header `append` does not need a value.
+ req = req.header(HeaderName::from_static("append"), "");
+ req = req.header(HeaderName::from_static("position"), position);
Review Comment:
I believe they are not in headers.
##########
core/src/services/oss/core.rs:
##########
@@ -186,6 +187,53 @@ impl OssCore {
Ok(req)
}
+ /// Oss append object request
+ ///
+ /// # Note
+ ///
+ /// This request is used to append data to an existing object or create an appendable object.
+ /// So you must set the `append` and `position` header.
Review Comment:
Who is `you`? Please make it clear.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org