gopherschwift

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 4 Imported by: 4

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().

Types

type Options

type Options struct {
	//If set, this User-Agent will be reported in HTTP requests instead of
	//schwift.DefaultUserAgent.
	UserAgent string
}

Options contains additional options that can be passed to Wrap().

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL