objectstorage

package
v0.0.0-...-d1703da Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2015 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyObject

func CopyObject(srcURL, destURL, token string) (err error)

CopyObject calls the OpenStack copy object API using previously obtained token. Note from API doc: "The destination container must exist before attempting the copy."

func DeleteContainer

func DeleteContainer(url, token string) error

DeleteContainer calls the OpenStack delete container API using previously obtained token.

func DeleteObject

func DeleteObject(url, token string) (err error)

DeleteObject calls the OpenStack delete object API using previously obtained token.

Note from API doc: "A DELETE to a versioned object removes the current version of the object and replaces it with the next-most current version, moving it from the non-current container to the current." .. "If you want to completely remove an object and you have five total versions of it, you must DELETE it five times."

func GetAccountMeta

func GetAccountMeta(url, token string) (http.Header, error)

GetAccountMeta calls the OpenStack retrieve account metadata API using previously obtained token.

func GetContainerMeta

func GetContainerMeta(url, token string) (http.Header, error)

GetContainerMeta calls the OpenStack retrieve object metadata API using previously obtained token. url can be regular storage or CDN-enabled storage URL.

func GetObject

func GetObject(url, token string) (http.Header, []byte, error)

GetObject calls the OpenStack retrieve object API using previously obtained token. It returns http.Header, object / file content downloaded from the server, and err.

Since this implementation of GetObject retrieves header info, it effectively executes GetObjectMeta also in addition to getting the object content.

func GetObjectMeta

func GetObjectMeta(url, token string) (http.Header, error)

GetObjectMeta calls the OpenStack retrieve object metadata API using previously obtained token.

func ListContainers

func ListContainers(limit int64, marker, url, token string) ([]byte, error)

ListContainers calls the OpenStack list containers API using previously obtained token. "limit" and "marker" corresponds to the API's "limit" and "marker". "url" can be regular storage or cdn-enabled storage URL. It returns []byte which then needs to be unmarshalled to decode the JSON.

func ListObjects

func ListObjects(limit int64,
	marker, prefix, path, delim, conURL, token string) ([]byte, error)

ListObjects calls the OpenStack list object API using previously obtained token. "Limit", "marker", "prefix", "path", "delim" corresponds to the API's "limit", "marker", "prefix", "path", and "delimiter".

func PutContainer

func PutContainer(url, token string, s ...string) error

PutContainer calls the OpenStack API to create / update container using previously obtained token.

func PutObject

func PutObject(fContent *[]byte, url, token string, s ...string) (err error)

PutObject calls the OpenStack create object API using previously obtained token. url can be regular storage or CDN-enabled storage URL.

func SetContainerMeta

func SetContainerMeta(url string, token string, s ...string) (err error)

SetContainerMeta calls the OpenStack API to create / update meta data for container using previously obtained token. url can be regular storage or CDN-enabled storage URL.

func SetObjectMeta

func SetObjectMeta(url string, token string, s ...string) (err error)

SetObjectMeta calls the OpenStack API to create/update meta data for object using previously obtained token.

Types

This section is empty.

Jump to

Keyboard shortcuts

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