From 9a7a1757275b34d88215a01097c92b9c12065daa Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 26 Sep 2020 13:03:26 +0200 Subject: [PATCH] Add docs about how to connect to swiftfs --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index c3e807ae..15da2a1d 100644 --- a/README.md +++ b/README.md @@ -258,6 +258,25 @@ system using InMemoryFile. Afero has experimental support for secure file transfer protocol (sftp). Which can be used to perform file operations over a encrypted channel. +### SwiftFs + +Afero can use openstack swift storage as a backend. +To use it, you need a `username`, `api key`, `auth url`, `domain` and `container name` for an openstack switch store: + +```go +fs, err = NewSwiftFs(&swift.Connection{ + UserName: "swift_username", + ApiKey: "swift_apikey", + AuthUrl: "swift_authurl", + Domain: "swift_domain", +}, "containername") +if err != nil { + fmt.Println("Error connecting to swift storage") +} +``` + +After creating a connection, you can use the backend in the same way as usual. + ## Filtering Backends ### BasePathFs