diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2018-04-29 15:37:13 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2018-04-29 15:37:13 +0200 |
| commit | 1f3fcfa9366e49b371c7be2b5c90b957ce93b8dd (patch) | |
| tree | a124a3cba94b10819b885df14ddae7efa0fe89c7 /gopherschwift/package.go | |
| parent | 55851ab5d1eb31f868ae45abdbdef152dd97b1ac (diff) | |
| download | go-schwift-1f3fcfa9366e49b371c7be2b5c90b957ce93b8dd.tar.gz | |
update documentation with new Gophercloud best practices
Diffstat (limited to 'gopherschwift/package.go')
| -rw-r--r-- | gopherschwift/package.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gopherschwift/package.go b/gopherschwift/package.go index 7c66b16..bd47b8d 100644 --- a/gopherschwift/package.go +++ b/gopherschwift/package.go @@ -25,13 +25,18 @@ you can use the Wrap() function in this package as an entrypoint to Schwift. A schwift.Account created this way will re-use Gophercloud's authentication code, so you only need to obtain a client token once using Gophercloud. For example: - authOptions, err := openstack.AuthOptionsFromEnv() // or build a gophercloud.AuthOptions instance yourself - provider, err := openstack.AuthenticatedClient(authOptions) - client, err := openstack.NewObjectStorageV1(provider, gophercloud.EndpointOpts{}) + import ( + "github.com/gophercloud/gophercloud/openstack" + "github.com/gophercloud/utils/openstack/clientconfig" + "github.com/majewsky/schwift/gopherschwift" + ) - account, err := gopherschwift.Wrap(client) + provider, err := clientconfig.AuthenticatedClient(nil) + client, err := openstack.NewObjectStorageV1(provider, gophercloud.EndpointOpts{}) + account, err := gopherschwift.Wrap(client) Using this schwift.Account instance, you have access to all of schwift's API. +Refer to the documentation in the parent package for details. */ package gopherschwift |
