Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Sep 21, 2023
1 parent 785581c commit bb8d0df
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use futures::FutureExt;
use opendal::Entry;
use opendal::Operator;

use super::webdav_file::convert_error;
use super::webdav_metadata::WebdavMetaData;
use super::file::convert_error;
use super::metadata::WebdavMetaData;

pub struct WebDAVDirEntry {
dir_entry: Entry,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use dav_server::fs::FsFuture;
use futures::FutureExt;
use opendal::Operator;

use super::webdav_metadata::WebdavMetaData;
use super::metadata::WebdavMetaData;

#[derive(Debug)]
pub struct WebdavFile {
Expand Down
10 changes: 5 additions & 5 deletions integrations/dav-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.

mod webdav_dir_entry;
mod webdav_file;
mod webdav_metadata;
pub mod webdavfs;
mod dir_entry;
mod file;
mod metadata;
mod opendalfs;

pub use dav_server::DavHandler;
pub use opendalfs::OpendalFs;
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ use futures_util::StreamExt;
use opendal::Lister;
use opendal::Operator;

use super::webdav_file::convert_error;
use super::webdav_file::WebdavFile;
use super::webdav_metadata::WebdavMetaData;
use crate::webdav_dir_entry::WebDAVDirEntry;
use super::file::convert_error;
use super::file::WebdavFile;
use super::metadata::WebdavMetaData;
use crate::dir_entry::WebDAVDirEntry;

#[derive(Clone)]
pub struct WebdavFs {
pub struct OpendalFs {
pub op: Operator,
}

impl DavFileSystem for WebdavFs {
impl DavFileSystem for OpendalFs {
fn open<'a>(
&'a self,
path: &'a dav_server::davpath::DavPath,
Expand Down Expand Up @@ -175,9 +175,9 @@ impl DavFileSystem for WebdavFs {
}
}

impl WebdavFs {
pub fn new(op: Operator) -> Box<WebdavFs> {
Box::new(WebdavFs { op })
impl OpendalFs {
pub fn new(op: Operator) -> Box<OpendalFs> {
Box::new(OpendalFs { op })
}
}

Expand Down
4 changes: 2 additions & 2 deletions integrations/dav-server/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use anyhow::Result;
use dav_server::davpath::DavPath;
use dav_server::fs::DavFileSystem;
use dav_server_opendalfs::webdavfs::WebdavFs;
use dav_server_opendalfs::OpendalFs;
use opendal::services::Fs;
use opendal::Operator;

Expand All @@ -29,7 +29,7 @@ async fn test() -> Result<()> {

let op = Operator::new(builder)?.finish();

let webdavfs = WebdavFs::new(op);
let webdavfs = OpendalFs::new(op);

let metadata = webdavfs
.metadata(&DavPath::new("/").unwrap())
Expand Down

0 comments on commit bb8d0df

Please sign in to comment.