Skip to content

Commit

Permalink
feat(service/azfile): add azure file service support (apache#3312)
Browse files Browse the repository at this point in the history
* feat: add azure file service support

Signed-off-by: Liuqing Yue <[email protected]>

* feat: add azure file list operation

Signed-off-by: Liuqing Yue <[email protected]>

* fix: parent path should exist

Signed-off-by: Liuqing Yue <[email protected]>

* fix: make clippy happy

* docs: polish

* fix: solve comments

---------

Signed-off-by: Liuqing Yue <[email protected]>
  • Loading branch information
dqhl76 authored Oct 17, 2023
1 parent 12becec commit 8c6e7db
Show file tree
Hide file tree
Showing 14 changed files with 1,427 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,10 @@ OPENDAL_D1_DATABASE_ID=<database_id>
OPENDAL_D1_TABLE=<table>
OPENDAL_D1_KEY_FIELD=<key_field>
OPENDAL_D1_VALUE_FIELD=<value_field>
# azfile
OPENDAL_AZFILE_TEST=false
OPENDAL_AZFILE_ENDPOINT=<endpoint>
OPENDAL_AZFILE_ROOT=/tmp/opendal/
OPENDAL_AZFILE_ACCOUNT_NAME=<account_name>
OPENDAL_AZFILE_ACCOUNT_KEY=<account_key>
OPENDAL_AZFILE_SHARE_NAME=<shared_name>
2 changes: 2 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ default = [
"services-s3",
"services-webdav",
"services-webhdfs",
"services-azfile",
]

# Build docs or not.
Expand Down Expand Up @@ -180,6 +181,7 @@ services-wasabi = [
]
services-webdav = []
services-webhdfs = []
services-azfile = []

[lib]
bench = false
Expand Down
4 changes: 2 additions & 2 deletions core/src/services/azdls/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ use opendal::Operator;

#[tokio::main]
async fn main() -> Result<()> {
// Create azblob backend builder.
// Create azdls backend builder.
let mut builder = Azdls::default();
// Set the root for azblob, all operations will happen under this root.
// Set the root for azdls, all operations will happen under this root.
//
// NOTE: the root must be absolute path.
builder.root("/path/to/dir");
Expand Down
2 changes: 1 addition & 1 deletion core/src/services/azdls/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub async fn parse_error(resp: Response<IncomingAsyncBody>) -> Result<Error> {
};

let mut message = match de::from_reader::<_, AzdlsError>(bs.clone().reader()) {
Ok(azblob_err) => format!("{azblob_err:?}"),
Ok(azdls_err) => format!("{azdls_err:?}"),
Err(_) => String::from_utf8_lossy(&bs).into_owned(),
};
// If there is no body here, fill with error code.
Expand Down
Loading

0 comments on commit 8c6e7db

Please sign in to comment.