From 1f3fcfa9366e49b371c7be2b5c90b957ce93b8dd Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Sun, 29 Apr 2018 15:37:13 +0200 Subject: update documentation with new Gophercloud best practices --- gopherschwift/package.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gopherschwift') 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 -- cgit v1.2.3