Crate dav_server_opendalfs

source ·
Expand description

dav-server-opendalfs is an dav-server implementation using opendal.

This crate can help you to access ANY storage services with the same webdav API.

use anyhow::Result;
use dav_server::davpath::DavPath;
use dav_server::fs::DavFileSystem;
use dav_server_opendalfs::OpendalFs;
use opendal::services::Memory;
use opendal::Operator;

#[tokio::test]
async fn test() -> Result<()> {
    let op = Operator::new(Memory::default())?.finish();

    let webdavfs = OpendalFs::new(op);

    let metadata = webdavfs
        .metadata(&DavPath::new("/").unwrap())
        .await
        .unwrap();
    println!("{}", metadata.is_dir());

    Ok(())
}

Structs§

  • OpendalFs is a DavFileSystem implementation for opendal.