WebDAV
WebDAV backend support.
Capabilities
This service can be used to:
- stat
- read
- write
- create_dir
- delete
- copy
- rename
- list
-
presign - blocking
Notes
Bazel Remote Caching and Ccache HTTP Storage is also part of this service.
Users can use webdav
to connect those services.
Configuration
endpoint
: set the endpoint for webdavroot
: Set the work directory for backend
You can refer to [WebdavBuilder
]'s docs for more information
Example
Via Builder
use anyhow::Result;
use opendal::services::Webdav;
use opendal::Operator;
#[tokio::main]
async fn main() -> Result<()> {
// create backend builder
let mut builder = Webdav::default();
builder.endpoint("127.0.0.1");
builder.username("xxx");
builder.password("xxx");
let op: Operator = Operator::new(builder)?.finish();
Ok(())
}
Via Config
- Rust
- Node.js
- Python
use anyhow::Result;
use opendal::Operator;
use opendal::Scheme;
use std::collections::HashMap;
#[tokio::main]
async fn main() -> Result<()> {
let mut map = HashMap::new();
map.insert("endpoint".to_string(), "127.0.0.1".to_string());
map.insert("username".to_string(), "xxx".to_string());
map.insert("password".to_string(), "xxx".to_string());
let op: Operator = Operator::via_map(Scheme::Webdav, map)?;
Ok(())
}
import { Operator } from "opendal";
async function main() {
const op = new Operator("webdav", {
endpoint: "127.0.0.1",
username: "xxx",
password: "xxx",
});
}
import opendal
op = opendal.Operator("webdav",
endpoint="127.0.0.1",
username="xxx",
password="xxx",
)