Skip to content

Commit

Permalink
feat(doc): add OpenStack Swift document for the website (#3494)
Browse files Browse the repository at this point in the history
* feat: add OpenStack Swift document for the website

* chore: fix typo
  • Loading branch information
morristai authored Nov 7, 2023
1 parent 6909f3a commit 1ac054d
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions website/docs/services/swift.mdx
Original file line number Diff line number Diff line change
@@ -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'

<Docs components={props.components} />

### Via Config

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs>
<TabItem value="rust" label="Rust" default>

```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("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());

let op: Operator = Operator::via_map(Scheme::Swift, map)?;
Ok(())
}
```

</TabItem>
<TabItem value="node.js" label="Node.js">

```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: "/",
});
}
```

</TabItem>
<TabItem value="python" label="Python">

```python
import opendal
op = opendal.Operator("swift",
endpoint="http://127.0.0.1:8080"
account="test_account",
container="test_container",
token="test_token",
root="/",
)
```

</TabItem>
</Tabs>

0 comments on commit 1ac054d

Please sign in to comment.