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/07/18 05:37:56 UTC

[GitHub] [incubator-opendal] Xuanwo commented on a diff in pull request #2658: add oay_webdav basic read impl

Xuanwo commented on code in PR #2658:
URL: https://github.com/apache/incubator-opendal/pull/2658#discussion_r1266241395


##########
bin/oay/src/services/mod.rs:
##########
@@ -15,5 +15,12 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#[cfg(feature = "frontends-s3")]
 mod s3;
+#[cfg(feature = "frontends-s3")]
 pub use s3::S3Service;
+
+#[cfg(feature = "frontends-webdav")]
+mod webdav;
+#[cfg(feature = "frontends-webdav")]
+pub use webdav::*;

Review Comment:
   Please don't use `pub use webdav::*` here. We expect only to export `WebdavService` here.



##########
bin/oay/src/services/webdav/webdav_metadata.rs:
##########
@@ -0,0 +1,38 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use dav_server::fs::DavMetaData;
+use opendal::Metadata;
+
+#[derive(Debug, Clone)]
+pub struct WebdavMetaData {
+    pub metadata: Metadata,

Review Comment:
   Maybe we don't need to export metadata field?



##########
bin/oay/src/bin/webdav.rs:
##########


Review Comment:
   This file should be called `oay.rs`. We will only have one binary called `oay`.



##########
bin/oay/src/services/webdav/webdav_file.rs:
##########
@@ -0,0 +1,80 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::{io::SeekFrom, sync::Arc};
+
+use dav_server::{
+    davpath::DavPath,
+    fs::{DavFile, DavMetaData, FsFuture, OpenOptions},
+};
+use futures::FutureExt;
+use opendal::Operator;
+
+use super::webdav_metadata::WebdavMetaData;
+
+#[derive(Debug)]
+pub struct WebdavFile {
+    pub op: Arc<Operator>,

Review Comment:
   Operator contains an `Arc` inside, so we can use `Operator` here directly.



-- 
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