From 87b8bf24011fa6bccf749c78289c1efe254cb615 Mon Sep 17 00:00:00 2001 From: Morris Tai Date: Mon, 6 Nov 2023 19:50:11 -0500 Subject: [PATCH 1/2] feat: add OpenStack Swift document for the website --- website/docs/services/swift.mdx | 70 +++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 website/docs/services/swift.mdx diff --git a/website/docs/services/swift.mdx b/website/docs/services/swift.mdx new file mode 100644 index 000000000000..8d1c49ede0eb --- /dev/null +++ b/website/docs/services/swift.mdx @@ -0,0 +1,70 @@ +--- +title: Swift +--- + +[OpenStack Swift](https://docs.openstack.org/api-ref/object-store/) service support. + +import Docs from '../../../core/src/services/swift/docs.md' + + + +### Via Config + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + +```rust +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(), "http://127.0.0.1:8080".to_string()); + map.insert("accout".to_string(), "test_account".to_string()); + map.insert("container".to_string(), "test_container".to_string()); + map.insert("token".to_string(), "test_token".to_string()); + map.insert("root".to_string(), "/".to_string()); + + let op: Operator = Operator::via_map(Scheme::Swift, map)?; + Ok(()) +} +``` + + + + +```javascript +import { Operator } from "opendal"; +async function main() { + const op = new Operator("swift", { + endpoint: "http://127.0.0.1:8080", + account: "test_account", + container: "test_container", + token: "test_token", + root: "/", + }); +} +``` + + + + +```python +import opendal +op = opendal.Operator("swift", + endpoint="http://127.0.0.1:8080" + account="test_account", + container="test_container", + token="test_token", + root="/", +) +``` + + + \ No newline at end of file From 088cf6536bad2757a15fd11a6a8c79f8f88fa955 Mon Sep 17 00:00:00 2001 From: Morris Tai Date: Mon, 6 Nov 2023 19:54:50 -0500 Subject: [PATCH 2/2] chore: fix typo --- website/docs/services/swift.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/services/swift.mdx b/website/docs/services/swift.mdx index 8d1c49ede0eb..bec27ea6f63a 100644 --- a/website/docs/services/swift.mdx +++ b/website/docs/services/swift.mdx @@ -26,7 +26,7 @@ use std::collections::HashMap; async fn main() -> Result<()> { let mut map = HashMap::new(); map.insert("endpoint".to_string(), "http://127.0.0.1:8080".to_string()); - map.insert("accout".to_string(), "test_account".to_string()); + map.insert("account".to_string(), "test_account".to_string()); map.insert("container".to_string(), "test_container".to_string()); map.insert("token".to_string(), "test_token".to_string()); map.insert("root".to_string(), "/".to_string());