Xuanwo commented on code in PR #2878:
URL: 
https://github.com/apache/incubator-opendal/pull/2878#discussion_r1299211105


##########
core/src/services/atomicdata/backend.rs:
##########
@@ -0,0 +1,208 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+use std::collections::HashMap;
+use std::fmt::Debug;
+use std::fmt::Formatter;
+use std::sync::Arc;
+
+use base64::prelude::BASE64_STANDARD;
+use base64::Engine;
+
+use atomic_lib::errors::AtomicError;
+use atomic_lib::storelike::Query;
+use atomic_lib::Store;
+use atomic_lib::Storelike;
+
+use async_trait::async_trait;
+
+use crate::raw::adapters::kv;
+use crate::raw::normalize_root;
+use crate::Builder;
+use crate::Scheme;
+use crate::*;
+
+/// Atomicdata service support.
+#[doc = include_str!("docs.md")]
+#[derive(Default)]
+pub struct AtomicdataBuilder {
+    root: Option<String>,
+    endpoint: Option<String>,
+}
+
+impl AtomicdataBuilder {
+    /// Set the root for Atomicdata.
+    pub fn root(&mut self, path: &str) -> &mut Self {
+        self.root = Some(path.into());
+        self
+    }
+
+    /// Set the server address for Atomicdata.
+    pub fn endpoint(&mut self, endpoint: &str) -> &mut Self {
+        self.endpoint = Some(endpoint.into());
+        self
+    }
+}
+
+impl Builder for AtomicdataBuilder {
+    const SCHEME: Scheme = Scheme::Atomicdata;
+    type Accessor = AtomicdataBackend;
+
+    fn from_map(map: HashMap<String, String>) -> Self {
+        let mut builder = AtomicdataBuilder::default();
+
+        map.get("root").map(|v| builder.root(v));
+        map.get("endpoint").map(|v| builder.endpoint(v));
+
+        builder
+    }
+
+    fn build(&mut self) -> Result<Self::Accessor> {
+        let store = atomic_lib::Store::init().unwrap();

Review Comment:
   > I can look into atomic-server. But the issue with `File` is that its 
`download_url` needs to be provided by us.
   
   Oh, that's not I expeceted.
   
   The [docs](https://docs.atomicdata.dev/files.html) said:
   
   > The server will check your authentication headers, your permissions, and 
will persist your uploaded file(s). It will now create File resources.
   
   And I have tried at https://atomicdata.dev/, it seems the server itself will 
maintain the `download_url`:
   
   
![image](https://github.com/apache/incubator-opendal/assets/5351546/f127600c-3141-49a9-b069-2df97b80f6df)
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to