Documentation ¶
Overview ¶
Package gopherschwift contains a Gophercloud backend for Schwift.
If your application uses Gophercloud (https://github.com/gophercloud/gophercloud), 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:
import ( "github.com/gophercloud/gophercloud/openstack" "github.com/gophercloud/utils/openstack/clientconfig" "github.com/majewsky/schwift/gopherschwift" ) 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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Wrap ¶
func Wrap(client *gophercloud.ServiceClient, opts *Options) (*schwift.Account, error)
Wrap creates a schwift.Account that uses the given service client as its backend. The service client must refer to a Swift endpoint, i.e. it should have been created by openstack.NewObjectStorageV1().