accounts

package
v0.3.0-dev Latest Latest
Warning

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

Go to latest
Published: May 21, 2015 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package accounts contains functionality for working with Object Storage account resources. An account is the top-level resource the object storage hierarchy: containers belong to accounts, objects belong to containers.

Another way of thinking of an account is like a namespace for all your resources. It is synonymous with a project or tenant in other OpenStack services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetHeader added in v0.2.0

type GetHeader struct {
	BytesUsed      int64     `mapstructure:"X-Account-Bytes-Used"`
	ContainerCount int       `mapstructure:"X-Account-Container-Count"`
	ContentLength  int64     `mapstructure:"Content-Length"`
	ContentType    string    `mapstructure:"Content-Type"`
	Date           time.Time `mapstructure:"-"`
	ObjectCount    int64     `mapstructure:"X-Account-Object-Count"`
	TransID        string    `mapstructure:"X-Trans-Id"`
	TempURLKey     string    `mapstructure:"X-Account-Meta-Temp-URL-Key"`
	TempURLKey2    string    `mapstructure:"X-Account-Meta-Temp-URL-Key-2"`
}

GetHeader represents the headers returned in the response from a Get request.

type GetOpts

type GetOpts struct {
	Newest bool `h:"X-Newest"`
}

GetOpts is a structure that contains parameters for getting an account's metadata.

func (GetOpts) ToAccountGetMap

func (opts GetOpts) ToAccountGetMap() (map[string]string, error)

ToAccountGetMap formats a GetOpts into a map[string]string of headers.

type GetOptsBuilder

type GetOptsBuilder interface {
	ToAccountGetMap() (map[string]string, error)
}

GetOptsBuilder allows extensions to add additional headers to the Get request.

type GetResult

type GetResult struct {
	gophercloud.HeaderResult
}

GetResult is returned from a call to the Get function.

func Get

Get is a function that retrieves an account's metadata. To extract just the custom metadata, call the ExtractMetadata method on the GetResult. To extract all the headers that are returned (including the metadata), call the ExtractHeader method on the GetResult.

func (GetResult) Extract added in v0.2.0

func (gr GetResult) Extract() (GetHeader, error)

Extract will return a struct of headers returned from a call to Get. To obtain a map of headers, call the ExtractHeader method on the GetResult.

func (GetResult) ExtractMetadata

func (gr GetResult) ExtractMetadata() (map[string]string, error)

ExtractMetadata is a function that takes a GetResult (of type *http.Response) and returns the custom metatdata associated with the account.

type UpdateHeader added in v0.2.0

type UpdateHeader struct {
	ContentLength string    `mapstructure:"Content-Length"`
	ContentType   string    `mapstructure:"Content-Type"`
	Date          time.Time `mapstructure:"-"`
	TransID       string    `mapstructure:"X-Trans-Id"`
}

UpdateHeader represents the headers returned in the response from an Update request.

type UpdateOpts

type UpdateOpts struct {
	Metadata          map[string]string
	ContentType       string `h:"Content-Type"`
	DetectContentType bool   `h:"X-Detect-Content-Type"`
	TempURLKey        string `h:"X-Account-Meta-Temp-URL-Key"`
	TempURLKey2       string `h:"X-Account-Meta-Temp-URL-Key-2"`
}

UpdateOpts is a structure that contains parameters for updating, creating, or deleting an account's metadata.

func (UpdateOpts) ToAccountUpdateMap

func (opts UpdateOpts) ToAccountUpdateMap() (map[string]string, error)

ToAccountUpdateMap formats an UpdateOpts into a map[string]string of headers.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToAccountUpdateMap() (map[string]string, error)
}

UpdateOptsBuilder allows extensions to add additional headers to the Update request.

type UpdateResult

type UpdateResult struct {
	gophercloud.HeaderResult
}

UpdateResult is returned from a call to the Update function.

func Update

Update is a function that creates, updates, or deletes an account's metadata. To extract the headers returned, call the Extract method on the UpdateResult.

func (UpdateResult) Extract added in v0.2.0

func (ur UpdateResult) Extract() (UpdateHeader, error)

Extract will return a struct of headers returned from a call to Get. To obtain a map of headers, call the ExtractHeader method on the GetResult.

Jump to

Keyboard shortcuts

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