Documentation ¶
Index ¶
- func Copy(c *storage.Client, opts CopyOpts) error
- func Create(c *storage.Client, opts CreateOpts) error
- func Delete(c *storage.Client, opts DeleteOpts) error
- func ExtractContent(dr DownloadResult) ([]byte, error)
- func ExtractMetadata(gr GetResult) map[string]string
- func ExtractNames(lr ListResult) ([]string, error)
- func Update(c *storage.Client, opts UpdateOpts) error
- type CopyOpts
- type CreateOpts
- type DeleteOpts
- type DownloadOpts
- type DownloadResult
- type GetOpts
- type GetResult
- type ListOpts
- type ListResult
- type Object
- type UpdateOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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.
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 ¶
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 ¶
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 ListResult ¶
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.