diff --git a/Cargo.lock b/Cargo.lock index c4b2f387be4f..691c4a05ff4e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2291,6 +2291,23 @@ dependencies = [ "libc", ] +[[package]] +name = "oay" +version = "0.32.0" +dependencies = [ + "anyhow", + "clap 4.1.11", + "dirs", + "env_logger", + "futures", + "log", + "opendal", + "serde", + "tokio", + "toml 0.7.3", + "url", +] + [[package]] name = "object_store" version = "0.5.5" diff --git a/Cargo.toml b/Cargo.toml index ab93a02a8d63..6608e18f6da3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ members = [ "bindings/java", "bin/oli", + "bin/oay", ] [workspace.package] diff --git a/bin/oay/Cargo.toml b/bin/oay/Cargo.toml new file mode 100644 index 000000000000..3bde725cae2d --- /dev/null +++ b/bin/oay/Cargo.toml @@ -0,0 +1,48 @@ +# 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. + +[package] +categories = ["filesystem"] +description = "OpenDAL Gateway" +keywords = ["storage", "data", "s3", "fs", "azblob"] +name = "oay" + +authors.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true + +[dependencies] +anyhow = "1" +clap = { version = "4", features = ["cargo", "string"] } +dirs = "5.0.0" +env_logger = "0.10" +futures = "0.3" +log = "0.4" +opendal.workspace = true +serde = { version = "1", features = ["derive"] } +tokio = { version = "1.27", features = [ + "fs", + "macros", + "rt-multi-thread", + "io-std", +] } +toml = "0.7.3" +url = "2.3.1" diff --git a/bin/oay/README.md b/bin/oay/README.md new file mode 100644 index 000000000000..caa23e57e101 --- /dev/null +++ b/bin/oay/README.md @@ -0,0 +1,13 @@ +# Oay + +Oay is an OpenDAL Gateway that empowers users to access data through their preferred APIs. + +## Goal + +Allow users to access different storage backend through their preferred APIs. + +![](https://user-images.githubusercontent.com/5351546/233089393-b4ce41df-3236-4dc7-969d-fa00468ae095.png) + +## Status + +Our first milestone is to provide S3 APIs. diff --git a/bin/oay/lib.rs b/bin/oay/lib.rs new file mode 100644 index 000000000000..b248758bc120 --- /dev/null +++ b/bin/oay/lib.rs @@ -0,0 +1,16 @@ +// 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. diff --git a/bin/oay/src/bin/oay.rs b/bin/oay/src/bin/oay.rs new file mode 100644 index 000000000000..c9b3b63866ab --- /dev/null +++ b/bin/oay/src/bin/oay.rs @@ -0,0 +1,25 @@ +// 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 anyhow::Result; + +#[tokio::main] +async fn main() -> Result<()> { + println!("Hello, world!"); + + Ok(()) +}