containers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(c *storage.Client, opts DeleteOpts) error

Delete is a function that deletes a container.

func ExtractMetadata

func ExtractMetadata(gr GetResult) map[string]string

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

func ExtractNames

func ExtractNames(lr ListResult) ([]string, error)

ExtractNames is a function that takes a ListResult (of type *http.Response) and returns the containers' names.

func Update

func Update(c *storage.Client, opts UpdateOpts) error

Update is a function that creates, updates, or deletes a container's metadata.

Types

type Container

type Container map[string]interface{}

Container is a structure that holds information related to a storage container.

func Create

func Create(c *storage.Client, opts CreateOpts) (Container, error)

Create is a function that creates a new container.

func ExtractInfo

func ExtractInfo(lr ListResult) ([]Container, error)

ExtractInfo is a function that takes a ListResult (of type *http.Response) and returns the containers' information.

type CreateOpts

type CreateOpts struct {
	Name     string
	Metadata map[string]string
	Headers  map[string]string
}

CreateOpts is a structure that holds parameters for creating a container.

type DeleteOpts

type DeleteOpts struct {
	Name   string
	Params map[string]string
}

DeleteOpts is a structure that holds parameters for deleting a container.

type GetOpts

type GetOpts struct {
	Name     string
	Metadata map[string]string
}

GetOpts is a structure that holds parameters for getting a container's metadata.

type GetResult

type GetResult *http.Response

GetResult is a *http.Response that is returned from a call to the Get function.

func Get

func Get(c *storage.Client, opts GetOpts) (GetResult, error)

Get is a function that retrieves the metadata of a container. To extract just the custom metadata, pass the GetResult response to the ExtractMetadata function.

type ListOpts

type ListOpts struct {
	Full   bool
	Params map[string]string
}

ListOpts is a structure that holds parameters for listing containers.

type ListResult

type ListResult *http.Response

ListResult is a *http.Response that is returned from a call to the List function.

func List

func List(c *storage.Client, opts ListOpts) (ListResult, error)

List is a function that retrieves all objects in a container. It also returns the details for the account. To extract just the container information or names, pass the ListResult response to the ExtractInfo or ExtractNames function, respectively.

type UpdateOpts

type UpdateOpts struct {
	Name     string
	Metadata map[string]string
	Headers  map[string]string
}

UpdateOpts is a structure that holds parameters for updating, creating, or deleting a container's metadata.

Jump to

Keyboard shortcuts

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