aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Majewsky <stefan.majewsky@sap.com>2021-05-28 13:53:57 +0200
committerStefan Majewsky <stefan.majewsky@sap.com>2021-05-28 13:53:57 +0200
commit4caefbba49a5675d39fa87f26a757f8131313598 (patch)
tree1f99a3d420ba82e1bcb20794cbfd7de423ad5d40
parentbd1c74594efeab1268531225d304ebae8992e286 (diff)
downloadgo-schwift-4caefbba49a5675d39fa87f26a757f8131313598.tar.gz
doc: extend usage example
-rw-r--r--README.md6
-rw-r--r--doc.go4
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index 00767a0..44d7387 100644
--- a/README.md
+++ b/README.md
@@ -53,7 +53,11 @@ account, err := gopherschwift.Wrap(client, nil)
```
From this point, follow the [API documentation](https://godoc.org/github.com/majewsky/schwift) for what you can do with
-the `schwift.Account` object.
+the `schwift.Account` object. For example, to download an object's contents into a string:
+
+```
+text, err := account.Container("foo").Object("bar.txt").Download(nil).AsString()
+```
## Why another Swift client library?
diff --git a/doc.go b/doc.go
index 1d0dca5..e4e7809 100644
--- a/doc.go
+++ b/doc.go
@@ -58,6 +58,10 @@ have access to all of schwift's API:
account, err := gopherschwift.Wrap(client)
+For example, to download an object's contents into a string:
+
+ text, err := account.Container("foo").Object("bar.txt").Download(nil).AsString()
+
Authentication with a different OpenStack library
If you use a different Go library to handle Keystone/Swift authentication, take