ipfs_webdav/lib.rs
1// Copyright 2022-2023 Debox Network
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7//
8
9#[macro_use]
10extern crate log;
11
12use webdav_handler::memls::MemLs;
13use webdav_handler::DavHandler;
14
15use crate::api::PeerApi;
16use crate::fs::PeerFs;
17
18pub mod api;
19
20mod cache;
21mod fs;
22
23/// Creates a WebDAV handler
24pub fn make_server(api: Box<dyn PeerApi>) -> DavHandler {
25 DavHandler::builder()
26 .filesystem(PeerFs::new(api))
27 .locksystem(MemLs::new())
28 .build_handler()
29}