objects

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(c *storage.Client, opts CopyOpts) error

Copy is a function that copies one object to another.

func Create

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

Create is a function that creates a new object or replaces an existing object.

func Delete

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

Delete is a function that deletes an object.

func ExtractContent

func ExtractContent(dr DownloadResult) ([]byte, error)

ExtractContent is a function that takes a DownloadResult (of type *http.Response) and returns the object's content.

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 object.

func ExtractNames

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

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

func Update

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

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

Types

type CopyOpts

type CopyOpts struct {
	Container    string
	Name         string
	NewContainer string
	NewName      string
	Metadata     map[string]string
	Headers      map[string]string
}

CopyOpts is a structure that holds parameters for copying one object to another.

type CreateOpts

type CreateOpts struct {
	Container string
	Name      string
	Content   *bytes.Buffer
	Metadata  map[string]string
	Headers   map[string]string
	Params    map[string]string
}

CreateOpts is a structure that holds parameters for creating an object.

type DeleteOpts

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

DeleteOpts is a structure that holds parameters for deleting an object.

type DownloadOpts

type DownloadOpts struct {
	Container string
	Name      string
	Headers   map[string]string
	Params    map[string]string
}

DownloadOpts is a structure that holds parameters for downloading an object.

type DownloadResult

type DownloadResult *http.Response

DownloadResult is a *http.Response that is returned from a call to the Download function.

func Download

func Download(c *storage.Client, opts DownloadOpts) (DownloadResult, error)

Download is a function that retrieves the content and metadata for an object. To extract just the content, pass the DownloadResult response to the ExtractContent function.

type GetOpts

type GetOpts struct {
	Container string
	Name      string
	Headers   map[string]string
	Params    map[string]string
}

GetOpts is a structure that holds parameters for getting an object'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 an object. To extract just the custom metadata, pass the GetResult response to the ExtractMetadata function.

type ListOpts

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

ListOpts is a structure that holds parameters for listing objects.

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 container. To extract only the object information or names, pass the ListResult response to the ExtractInfo or ExtractNames function, respectively.

type Object

type Object map[string]interface{}

Object is a structure that holds information related to a storage object.

func ExtractInfo

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

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

type UpdateOpts

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

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

Jump to

Keyboard shortcuts

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